CSC323 2010S Software Design

Beautiful Code: When a Button Is All That Connects You to the World

Mehta, Arun (2007). When a Button Is All That Connects You to the World. Chapter 30 (pp. 483-501) in Oram & Wilson (eds), Beautiful Code. Sebastapol, CA: O'Reilly.

It seems like the problem was more beautiful than the solution. Could Markov chains possibly be a better choice here for finding efficient suggested paths of browsing than sub-trees and caches? (as Markov chains are commonly used to predict navigation patterns of users on websites). What changes to the design would one have to make to implement a Markov chain solution? It seems like a more elegant and natural choice.

Why is Visual Basic a good language for rapid prototyping of software? It seems like a language like Python would be better for that, since you wouldn't have to rewrite the application to run it in the real world. Did the author do this because he was bad at coding? If he was bad at coding, why was he featured in a book called "Beautiful Code"? In regards to presentation, why didn't the author use tree diagrams to help explain his software to the reader? Each time I turned the page I expected one, but there weren't any.

What makes Visual Basic ideal for this application? What makes it "easy to build a graphical user interface" and an "excellent rapid prototyping tool?"

It seems to me that a useful feature for this system would be the ability to store a variety of "common words" caches for different contexts-- the common words Professor Hawking uses while lecturing about astrophysics is different from the common words he uses to get food. Maybe this is a feature that just isn't mentioned.

What are the code examples here doing in a book entitled Beautiful Code? I could find very little beautiful in them.

In the opening of the chapter, Mehta notes that Hawking's old voice system ran software whose source code was unavailable. The new version was written to replace it when its hardware died. Mehta releases this code as open source software, but notes at the end of the chapter that it is an unmaintainable pile of spaghetti. How is producing unmaintainable code much better than leaving source code proprietary? Software for the disabled, in particular, may require various extensions and changes to serve its users, so why did Mehta not design his code that way in the first place?

Skilled Morse Code operators can easily code at 30wpm. That sounds like it would be faster (or at least simpler) than the requiring users to select from a cycling set of characters. Why did Mehta not try this interface?

Why didn't the author think to implement a double click system as well? Wouldn't that have offered the user greater navigational ability? Also, the author admits this code is like a 'bowl of spaghetti', why is it considered beautiful?

I don't completely understand the interrelational functions of the three boxes. Each box seems to have several different purposes and ways to connect, but how does this come all together?

There doesn't seem to be any way to type words that are not already in the system's dictionary. Am I missing something or is it just not possible (and why not)?

In the Sub longclick_timer() code segment how is the recursive search for longClickFile implemented. It appears that openLongClickFile is just called on MenuTree.SelectedItem.Parent and the parent is never checked.

Can you please explain what is meant by Dynamic Repopulation? Also, when reading this chapter it seemed inefficient to be rapidly prototyping the code in VB if the programmers were planning to map the ideas to another language in the future. Why not just design the code using UML or use cases and then write the Software in Java? What are the benefits of approaching the problem the way they did?

I found this chapter very interesting; I believe it's because it was a real-world application that seems like it matters. The code included didn't stand out to me as especially stunning, so I assume that this chapter is included because of the function of the software rather than the beauty of the code. I was struck by the author's discussion of ways to extend programming environments so that they are accessible, and wondered if there are any conventions that programmers use to make it easier to extend their work into accessible programs?

Nouns are important. Use cases let you think about different scenarios in which your code may or may not work. Maria was smart. The programmers were rude when an intern upstaged them. The UML sounds like a useful programming idea, universalizing the way that we pictorially represent code, but how widespread is it? A "universal" language only works if everyone actually knows it.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Tue Feb 16 08:15:35 2010.
The source to the document was last modified on Tue Feb 16 08:15:22 2010.
This document may be found at

You may wish to validate this document's HTML ; Valid CSS! ; Creative Commons License

Samuel A. Rebelsky,

Copyright © 2010 Samuel A. Rebelsky. This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. To view a copy of this license, visit or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.