Online Book Reader

Home Category

Beautiful Code [340]

By Root 5133 0
time. Large software systems where a single engineer focuses exclusively on the project for a number of years are almost nonexistent; that form of single-minded focus usually leads to rapid burnout!

In contrast, Emacspeak is an example of a large software system that has had a single engineer focused on it over a period of 12 years, but only in his spare time. A consequence of developing the system single-handedly over a number of years is that the code base has tended to be naturally "bushy." Notice the distribution of files and lines of code summarized in Table 31-1.

Table 31-1. Summary of Emacspeak codebase

Layer Files Lines Percentage

TTS core 6 3866 6.0

Emacspeak core 16 12174 18.9

Emacspeak extensions 160 48339 75.0

Total 182 64379 99.9

Table 31-1 highlights the following points:

The TTS core responsible for high-quality speech output is isolated in 6 out of 182 files, and makes up six percent of the code base.

The Emacspeak core—which provides high-level speech services to Emacspeak extensions, in addition to speech-enabling all basic Emacs functionality—is isolated to 16 files, and makes up about 19 percent of the code base.

The rest of the system is split across 160 files, which can be independently improved (or broken) without affecting the rest of the system. Many modules, such as emacspeak-url-template, are themselves bushy—i.e., an individual URL template can be modified without affecting any of the other URL templates.

advice reduces code size. The Emacspeak code base, which has approximately 60,000 lines of Lisp code, is a fraction of the size of the underlying system being speech-enabled. A rough count at the end of December 2006 shows that Emacs 22 has over a million lines of Lisp code; in addition, Emacspeak speech-enables a large number of applications not bundled by default with Emacs.

31.4.2. Conclusion

Here is a brief summary of the insights gained from implementing and using Emacspeak:

Lisp advice, and its object-oriented equivalent Aspect Oriented Programming, are very effective means for implementing cross-cutting concerns—e.g., speech-enabling a visual interface.

advice is a powerful means for discovering potential points of extension in a complex software system.

Focusing on basic web architecture, and relying on a data-oriented web backed by standardized protocols and formats, leads to powerful spoken web access.

Focusing on the final user experience, as opposed to individual interaction widgets such as sliders and tree controls, leads to a highly efficient, eyes-free environment.

Visual interaction relies heavily on the human eye's ability to rapidly scan the visual display. Effective eyes-free interaction requires transferring some of this responsibility to the computer because listening to large amounts of information is time-consuming. Thus, search in every form is critical for delivering effective eyes-free interaction, on the continuum from the smallest scale (such as Emacs' incremental search to find the right item in a local document) to the largest (such as a Google search to quickly find the right document on the global Web).

Visual complexity, which may become merely an irritant for users capable of using complex visual interfaces, is a show-stopper for eyes-free interaction. Conversely, tools that emerge early in an eyes-free environment eventually show up in the mainstream when the nuisance value of complex visual interfaces crosses a certain threshold. Two examples of this from the Emacspeak experience are:

—RSS and Atom feeds replacing the need for screen-scraping just to retrieve essential information such as the titles of articles.

—Emacspeak's use of XSLT to filter content in 2000 parallels the advent of Grease-monkey for applying custom client-side JavaScript to web pages in 2005.

Emacspeak: The Complete Audio Desktop > Acknowledgments

31.5. Acknowledgments

Emacspeak would not exist without Emacs and the ever-vibrant Emacs developer community that has made it possible to do everything from within Emacs. The Emacspeak

Return Main Page Previous Page Next Page

®Online Book Reader