This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.
|
Browsing Innovations For Books on CD-ROM
Scott Meyers |
The powers of HTML aren't limited to standard Web sites. You can use HTML techniques to make book-based data easier to navigate and read. |
What should a book on a CD-ROM look like? How should it behave? When I began to think
seriously about putting my book, Effective C++ (Addison-Wesley, 1998), onto a CD in the spring of 1998, I didn't know. From what I could tell by talking to producers and consumers of existing CD books, nobody else did either.
One thing I did know was that HTML was my publishing medium of choice. That meant putting a book on a CD boiled down to developing a Web site. I also knew that I disliked the design of most Web sites I'd seen. As you'll see, the design of My collaborators and I came up with several browsing innovations for the CD. Most ideas are as applicable to Internet-based Web sites as they are to sites published on CD, but some address CD-specific problems. Some innovations grew out of the special demands made by book-length documents, and these innovations, too, are as applicable to traditional Web sites as they are to Web sites masquerading as small plastic discs. The first innovation I'll examine here is user control over image sizes. Web browsers give users control over the display font size, but they typically give users no control over the size of images. The Effective C++ CD allows users to dynamically change image sizes to suit their monitor size, graphics resolution, and personal preferences. Another innovation is user control over navigation area sizes. Most Web sites have an area reserved for navigational aids, but the size of the material in this area is typically fixed. On the Effective C++ CD, users can control the size of the material in the navigation area similarly to the way they control the size of images. My CD also offers user control over file sizes. How should a long document like a book be broken down into individual HTML files? There are advantages and disadvantages to every solution. The Effective C++ CD exploits the fact that CDs are large enough to hold many copies of a book; three copies of the content are provided (each broken down into different file sizes), and users dynamically choose the size they prefer. Another novelty in the CD is paragraph-specific bookmarking. Most Web sites support the creation of bookmarks at only the top of a page and at major headings within a page. This level of granularityakin to the index of a book listing only the chapter where a topic is discussedis inadequate. The Effective C++ CD addresses this weakness by allowing any paragraph on the CD to be bookmarked. In addition, each paragraph's unique URL is made easily available, so it's simple to link other HTML documents to any specific paragraph on the CD. The CD also offers more efficient searching. Most HTML search engines do a poor job of identifying where in a document a particular phrase occurs. On the Effective C++ CD, searches identify each paragraph on the CD that satisfies a query. Finally, the CD preserves link validity. URLs on the Internet are notoriously unstable, but CDs are read-only, hence not updatable. Each link to the Internet on the Effective C++ CD goes indirectly through an online table of URLs, so if a URL changes, only the online table needs to be modified; the CD itself remains unchanged. Each innovation is discussed in more detail throughout this article. To avoid confusion, I should explain that the CD actually contains two of my books, Effective C++ (Second Edition) and More Effective C++ (Addison-Wesley, 1996).
User Control Over Image Sizes
|
Figure 1: A Selection of Image Sizes |
When a user requests a different image size, the change occurs immediately; there is no need to reload the document. Thus, it's practical for users to change image sizes depending on the specifics of the image, for example how much detail is present in the image itself.
User Control Over Navigation Area Sizes
|
Figure 2: Adjusting the Navigation Area |
Of course, this is not the only way to give users control over the size of navigational aids. Microsoft HTML Help uses a two-pane design for the client area that gives users control over the location of the split between the navigation and content areas, and Microsoft® Internet Explorer uses a similar design to separate navigation (including searching, favorites, and history) from document content, as shown in Figures 3 and 4. |
Figure 3: Resizable Panes in HTML Help |
Figure 4: A Two-pane Design in Internet Explorer |
This is a nice design, but though it allows users to reduce the area allotted for navigational aids, it affords no way for them to scale down the space needed for the information in the navigation area. Instead, the information is simply clipped on the right and users must grapple with cumbersome horizontal scroll controls (see Figure 5). |
Figure 5: Clipped Text |
The design used on the Effective C++ CD allows users to reduce the size of the navigation area while still displaying all of the information within it. Another approach to this problem is to make the navigation area a window in its own right instead of a pane in the content window. The navigation window can then be minimized independent of the content window, thus maximizing the display area for a document's content while simultaneously making a full-size navigation area available by using a single mouse operation. The Web site for Clarkson University (http://www.clarkson.edu) provides this kind of "remote control" capability (see Figure 6). |
Figure 6: The Navigation Area as a Separate Window |
Internet Explorer gives users the ability to toggle the visibility of the navigation pane. Unlike the design employed by the Effective C++ CD, however, neither the Clarkson site design nor the Internet Explorer feature gives users control over the horizontal space required to display the information in the navigation area. (The navigation area in the Clarkson design determines line breaks dynamically, but the size of the text is not adjusted if the window is made narrower. If graphics were used in the Clarkson design, they would presumably be fixed in size.) An ideal design would probably offer users all three capabilities: control over the space required to display the information (as on the Effective C++ CD), control over the space available to display the information (as in HTML Help), and control over the visibility of the navigation area itself (as in Internet Explorer).
User Control Over
File Sizes
The big drawback to browser-based searches is that they work on only the current file. It's not practical to put all the information on this CD in a single file, so there's a trade-off to be made. Bigger files support more complete browser-based searches, but the files take longer to load and demand more memory. Smaller files load faster and use less memory, but they yield more limited browser searches. To resolve this dilemma, I decided to let you make the call. This CD contains three copies of each book, each broken down into files of different sizes, and you choose the granularity you like best.By now, I hope a trend in the design of the CD is emerging. When there are multiple ways to do something and no way is clearly superior to the others, I try to support several or all of them, then let users decide what's best. I've found this to be a much more reasonable way to take advantage of a CD's relatively large capacity than, for example, the inclusion of gratuitous multimedia features such as video clips. More significantly, this philosophy corresponds to my belief that users should control their viewing experiencenot Web designers. The increasingly large number of magazine-like sites where Web designers control as much as they possibly canincluding font choices, graphic sizes, even line breaksrun contrary to the promise of HTML. In an HTML document, the reader should be in control. Only the reader knows how much screen space is available for the browser window. Only the reader knows which fonts and font sizes are most readable. Only the reader knows what size graphics are most useful. Designers uncomfortable with this reader-centric view of publishing should eschew HTML and consider PDF instead.
Paragraph-specific Bookmarking
Item M28 on Smart Pointers, for example, covers more than 20 pages in the printed book, so you might want to create a link that leads specifically to my discussion of how to emulate inheritance-based implicit type conversions among smart pointer types. I address that topic over halfway through the Item, and it's reasonable to want to jump directly to that discussion.The Effective C++ CD deals with this problem in a rather radical way. Each paragraph on the CD has its own URL, and each paragraph on the CD ends with a ¤ symbol that is a link to the beginning of the paragraph. This symbol is called the paragraph's dingbat (see Figure 7). |
Figure 7: The Paragraph Dingbat |
In theory, it should be possible to bookmark a paragraph by clicking on its dingbat (to jump to the URL corresponding to the beginning of the paragraph), then using your browser's Favorites command in the usual fashion. Some browsers (notably Internet Explorer) fail to implement this functionality correctly, but the CD describes workarounds for such problems. The workarounds are not terribly interesting. What is interesting is that the CD makes it possible to discover the URL for a paragraph by using the dingbat directly. When the cursor is moved over a dingbat, the dingbat expands into a text description of the paragraph. This is typically an abbreviated version of the document's title plus the number of the paragraph within the document. Figure 8 is the previous example with the dingbat expanded into "CD Intro, P24". |
Figure 8: An Expanded Dingbat |
When the dingbat is expanded, browser commands can be used to bookmark it; the text description then becomes the title of the bookmark. Using Netscape Navigator under Windows®, for example, users just right-click the expanded dingbat, then select Add Bookmark from the resulting pop-up menu. Using similar browser commands, users can copy the URL for a dingbat to the Clipboard. This means it's easy to create links from other HTML documents into the Effective C++ CD. That is, not only do paragraph-specific URLs (and the dingbats through which users interact with them) facilitate bookmarking specific information for particular users, they also facilitate the integration of the CD with other collections of HTML documents. For example, I expect many users to link to specific parts of the CD from other HTML documents they have that describe their C++ coding standards. Because each paragraph on the CD has a number associated with its dingbat, it becomes both possible and easy for people to identify specific locations on the CD. For example, people can refer to paragraph 24 of the CD's introduction or to paragraph 99 of Item 31 of More Effective C++. This has proven to be remarkably useful. For example, it enables users of the CD to identify locations of confusion or possible errors in the material and the CD's online errata list can identify locations of defects I have verified. Moreover, the idea of giving each paragraph at a Web site a unique identifier generalizes astonishingly well; there is otherwise no easy way to specify a particular location within a Web site. Document titles have a granularity that is far too coarse to serve this purpose, yet this is traditionally the only thing Web site designers offer their users.
More Efficient Searching
|
Figure 9: Searching on the CD |
Preservation of Link Validity
All links from this CD to the Internet go to the Addison-Wesley Web site, where they're translated into the correct URL (to the best of AW's knowledge), and your browser is then automatically forwarded to the correct place in cyberspace. Going indirect via AW's Web site for Internet links imposes a small performance penalty, but I think it's more than made up for by the fact that when a URL changes, all AW has to do is update its translation table, and your CD continues to work.In practice, I have been pleased to see that the performance penalty is rarely noticeable.
Experiencing the CD
|
From the October 1999 issue of Microsoft Internet Developer.
|