eBlue, Sacra Blue Online Magazine
MAr 2001 — Issue 224
eBlue articles
Tom Anderson
Hard Copy

Edited by
Tom Anderson




Contact Information:
Book Review Editor
Tom Anderson
916-488-1870

Next Time I Get Stuck on an Island…

Delphi 5 Developer’s Guide
Review by Tim Feldman

Some time ago, I worked as a senior programmer at a company that was part of a large multinational conglomerate. I wrote embedded software for large hydraulic systems—REAL hardware that could easily pick you up and throw you across the warehouse if you got in its way.

One day, the management drafted me to help out another division that was designing a big cargo-handling system for a major airline. It seemed that they were falling way behind in their programming and were facing stiff daily cash penalties if they didn’t deliver in time. So, on very short notice, I was sent overseas along with another of our senior programmers, under orders to roll up my sleeves and start programming.

I won’t tell you the names of any of the other parties involved, because it was something of a mess (the other company’s problems were mostly in management, not in engineering). In fact, I won’t even tell you where I was sent. Suffice it to say that it was an island country, fairly advanced technologically, but with a poor information infrastructure. Language wasn’t a barrier—most of the natives spoke English, in one form or another—but the social environment was quite drab. The village where I stayed had practically no Internet access, no movies, and limited radio and television. There was a public library, but it was closed on evenings and weekends. Also, I had no car.

Luckily, I did have a laptop computer loaded with programming tools, and the electricity was fairly stable, so I was able to do some recreational programming in my spare time.

Now, if you were stuck on an island in a situation such as mine, what books would you wish for? I know what I would have wished for. The one programming book that I would have brought along instead of any other is the Delphi 5 Developer’s Guide, by Steve Teixeira and Xavier Pacheco.

Delphi is my programming language of choice for Windows GUI programming, and Teixeira and Pacheco’s book is my book of choice. I’ll tell you all about it in this review.

Content
First of all, it’s a massive book. It has more than 1500 pages in 27 printed chapters and an appendix; but the authors found that wasn’t enough, so they packed nine more chapters and two more appendices onto a CD-ROM that comes with the book. They explain that there just wasn’t any other practical way to present all of the material. Breaking the book into two volumes would have made it too expensive, and a CD-ROM was needed anyway, to hold their nearly 1500 files of source code, data, example tools, and other material.

Between the book and the CD-ROM, there are more than 2000 pages of text. The parts that are on the CD-ROM are in a single large Adobe Acrobat PDF file.

As you might expect given the size of the book, the DDG (as its authors call it) is a comprehensive tour of Delphi. It covers all aspects of using the Delphi development tools and the Object Pascal language in the Windows 32-bit environment. To do that, it often must explain quite a bit about Windows programming. It manages to do that very well, avoiding the trap of going into dreary depth about the minute details of the Win32 programming API. Instead, it exposes just the right amount of information for you to get the job done rapidly and efficiently. In that way, the DDG and Delphi itself are very much alike: After using them, I’m struck by how easy they make Windows programming, compared to other environments such as Microsoft’s Visual C++.

So, what does this huge book/CD-ROM set cover? It consists of five major sections, starting with the essentials of using Delphi for rapid Windows application development. That first section alone contains hundreds of pages, taking you from basics to using ActiveX controls. Along the way, it reviews the Object Pascal language at the heart of Delphi; the Delphi Integrated Development Environment; the Windows 32-bit API; the Windows messaging system; and other fundamentals of Delphi development.

The second section continues with advanced techniques for serious Delphi application programmers. This includes using DLLs; writing multithreaded applications; graphics; printing; multimedia programming; porting Delphi applications to Delphi version 5 from earlier versions; and much more.

This is one of my favorite sections; it contains the topics that I always look for in any new book about Delphi. When I find a book that spends more than a few pages on any of those topics, I perk up and take notice, because it means that the author is getting into the real meat of Windows programming. The DDG is a great book for this kind of material. It covers all of the important topics very well.

For example, Chapter 11 deals with multithreading. I’ve observed that experienced Windows programmers write their big applications differently once they master multithreading; it’s one of those fundamental concepts that changes the way you see software architecture. When you understand it, you tend to design your program as a collection of cooperating processes, rather than as a big block of code that handles everything itself. It’s like the change that you go through when you learn about Windows event-driven programming in contrast to the sequential, centrally-controlled style of DOS programs. Or, like the change that you go through when you move to a truly component-oriented programming language such as Delphi, compared to the older methods of programming directly to the intricate Windows API using C++.

So multithreading is an important topic for advanced Windows programmers. The DDG does a very good job of explaining it clearly. The authors give good basic explanations of the concepts involved. They provide code snippets to illustrate the ideas, and then they incorporate the ideas into realistic and useful demonstration programs. I like that approach better than other books that present a complete program first and then dissect it in excruciating detail.

I got even more mileage out of this chapter by typing in the code snippets, and then trying to flesh them out into working programs before I saw how the authors did it in the demonstration programs. That way, I was an active participant in the learning process, not just a loafer sitting back while the results were handed to me.

The demonstration programs perform real tasks, instead of just modifying and printing out the value of a variable named "foo," as so many boring texts do. Because they are real, the DDG’s programs are interesting and easier to grasp. Many times after running one of the programs and seeing how simply it achieved its goals, I wanted to dive right in and use its ideas in a program of my own. Other times, I was strongly tempted to rewrite some of my own older programs to make them as clear and simple as the ones in the DDG.

By the end of the chapter, I felt that I really understood Windows multithreading, and I felt confident about using it in my own applications. The other chapters in the DDG cover their topics in the same manner and with the same depth; it is an excellent guide to Delphi Windows development.

Of course, there are many advanced subjects in Windows programming, and it would be unrealistic to expect a general book to cover the more specialized ones. For example, if I’m looking for details about writing asynchronous communications programs, 3D graphics engines, or USB device drivers, I don’t expect to find them in a general book such as the DDG. It deals with topics of broad applicability, and with using Delphi as it was intended to be used.

The third section is another favorite of mine. The earlier sections show how to build a Delphi application that is architecturally strong and full-featured; this section shows how to flesh it out with "components" that can make it visually interesting and a snap to develop.

Components are "software objects." They are one of the basic concepts that make it so easy to get things done with Delphi.

There are different kinds of components: familiar visible ones such as Windows buttons, dialog boxes, and scrollbars; invisible ones, such as timers and database access tools; Windows ActiveX components for connecting your own programs directly to other programs such as Word and Excel; and a myriad of special-purpose components from third parties, for performing a wide variety of tasks.

The whole point of object-oriented programming is to make software objects that are flexible and relatively easy for you to use in your own applications. Borland combined that concept with their fast, efficient Pascal compiler to create Delphi.

They got it right and Delphi became very popular very quickly, upsetting the rule of Microsoft’s Visual Basic and Visual C++ environments.

With Delphi’s components, unlike Visual C++ with its classes, frameworks, and explicit messages, it’s easy to use object-oriented programming techniques. The material in this section of the DDG makes it even easier. It explains the basics of the different kinds of components, and shows you how to create your own components, including ActiveX components. It even demonstrates how to extend the Windows Shell, allowing you to customize the Taskbar and other important parts of the Windows GUI. This section finishes by teaching you how to work with important object-oriented technologies such as Microsoft’s COM and the competing CORBA standard.

The remaining two sections of the DDG are about database programming with Delphi. In addition to client-server database programming, these sections show how to add Internet functionality to database programs using WebBroker components that work with the ISAPI and NSAPI APIs. This is a fairly new area, and you’ll only have the WebBroker components if you have the Enterprise edition of Delphi, or if you have the Professional edition and you bought WebBroker separately. I don’t have WebBroker, so I didn’t explore this section of the DDG very deeply; but it looks as comprehensive as the other sections.

The three appendices list various Delphi and Borland Database Engine error codes, and list several programmer’s books on Delphi, Windows, object-oriented programming, software project management, and user interface design.

To summarize the DDG’s content: It is a comprehensive, detailed guide to all of the features of using Delphi for Windows development, from basics to quite advanced subjects. The material is aimed at experienced programmers, but it is presented so well that any serious programmer should be able to use it.

Quality and Style
A certain famous software company produces bloated suites of office software that contain many features. Unfortunately, those applications are designed and executed so poorly that I can’t stand to use them; for me, they might as well not exist, even if they are the de facto Windows standard. The moral is that content is important, but so are execution and presentation. So in this section, I’ll investigate the quality of the DDG’s text and code, and I’ll describe the author’s writing style.

I expected the text of the DDG to be well written, because it is the latest in a line of Delphi Developer’s Guides from Teixeira and Pacheco. They have written three previous versions, winning several awards. This version didn’t disappoint me: I found neither errors nor significant omissions in the concepts and details that it discusses. It is a high-quality piece of work, polished and complete.

The step-by-step instructions for complex tasks are quite good; they are accompanied by explanations so that you learn why you are doing each step. I found that to be true for all of the DDG: The authors’ intent seems to be to teach you so that you understand the material, not just learn how to follow a canned procedure or recipe.

The parts of the DDG that are on the CD-ROM are not an afterthought; they are written as well as the printed chapters.

Incidentally, three of the chapters in the DDG are by other contributors, but the other 33 chapters are by Teixeira and Pacheco. All of them are written to the same high standards.

The code in the DDG is also pretty good. I installed all of it on my hard disk; it took up about 10 MB before I compiled any of it. I built many of the projects, and had very few problems with any of them.

I do feel that the authors are a bit stingy about putting comments in their source code. That’s not a problem in a book like this, since they explain the source code quite well in the accompanying text; but real-world programs should have more comments than this.

I had some problems with one of the longer programs in the DDG. It’s the DelSrch program from the chapter on creating multithreaded applications. DelSrch searches multiple files for specified text strings. When it finds a file containing the string, it displays the file name, and it optionally displays the line in the file containing the string.

The program is intended for searching files that contain only printable characters. When I use it to search a file that contains unprintable characters, it often crashes if it tries to display the string. The bug has little to do with multithreading, so perhaps it’s not too important in the context of the chapter’s material; but it seems like a pretty obvious mistake to protect against, and I’m a bit disappointed that the authors missed it. On the other hand, it gave me a good reason to go over their chapter on Delphi 5’s debugging tools!

The book is very well edited. I found very few grammatical or typographical errors. It has several layout features that make it easier to use, such as printed chapter thumbmarks on the edge of each page, and distinctive shading for sidebar material such as notes and tips.

Almost all of the source code listings of complete programs are on the CD-ROM. A few of the listings don’t include the name of their CD-ROM folder; you have to open and examine a few Delphi projects to figure out which one is which. That’s one of the few editing errors that slipped into the DDG, and it’s a pretty minor one.

I like the "Contents at a Glance" table that precedes the main Table of Contents; it helps you find the major topics in this lengthy book. The main Table of Contents is itself more than 20 pages long!

The Table of Contents and Index are well done, but I did find some minor problems there. The page numbers in the printed book match those in the printed Contents and the Index, but the page numbers in the PDF file don’t always match the printed page numbers in the Contents or Index. The reason: Someone left out the occasional blank page that finishes a chapter—but they didn’t leave out its page number!

For example, Chapter 6 in the PDF file ends with page 19. Since that is a right-hand page, page 20 is kept blank so that Chapter 7 starts on page 21, another right-hand page. They numbered the images of the pages that way, but they left the actual blank pages out of the PDF file. So after a few chapters, the page numbers in the images and in the printed Contents and the Index don’t match the numbers displayed by Acrobat as you page through the file.

The PDF page number problem isn’t a big deal; by the end of the PDF file, the page numbers are off by only 4 pages, so it isn’t too hard to find the item that you are looking for. You can also use Acrobat Reader’s find and search tools to help you.

There is a second PDF file problem that is more irritating: The PDF file’s security settings don’t let you print it!

Fortunately, there is a workaround: You can download a printable version of the PDF file from the Web site of one of the authors (Xapware). At 2.6 MB, it’s a big download. Sadly, it does not fix the page-number hiccup.

I didn’t encounter any other problems with the CD-ROM. Of course, I didn’t try out everything on it: Its 250 MB are full of third-party evaluation copies of Delphi tools and components, as well as the PDF file and the source code for the DDG.

The CD-ROM autostarts a program that lets you browse or install the source code and the PDF file. It also describes each third-party product and lets you install them individually.

Finally, it lets you connect to the publisher’s Web site, and it encourages you to register the book to receive various communications and promotions from the publishers.

The authors’ writing style is an excellent match to Delphi and the DDG: They are consistent, efficient and unobtrusive. There really isn’t too much more to say about their style. They aren’t technical snobs. They don’t "dumb down" the book or fill it with silly cartoons, though they do reveal a sly technical sense of humor in a few appropriate places. They don’t pad the book. They include plenty of useful notes and tips in sidebars. In short, their style is just right.

I’ve reviewed the content, quality and style of the DDG. You can tell that I like it a lot. I’m sure that if I’d had a copy of the Delphi 5 Developer’s Guide with me the last time I was stuck on an island with only a laptop computer for company, the long cold evenings and eventless weekends wouldn’t have been such a drag.

The only problem would have been when leaving the country: I might not have had enough space in my luggage for this massive book!
Delphi 5 Developer’s Guide
Steve Teixeira and Xavier Pacheco
Sams Publishing, 1999
ISBN 0-672-31781-8, $59.99
1556 printed pages, plus 250 MB of additional text, source code and other material on CD-ROM
(See Xapware for important updates to the book.)


Windows 2000 Quick Fixes
Review by Tom Anderson

After months of enduring Windows 98, I finally worked up the courage to install Windows 2000 on the new 40-gig hard drive I got at Fry’s. But, being a natural worrywart (and trusting Microsoft about as much as Florida election figures), I could see a whole world of land mines ahead of me. I had lists of questions and no answers.

This new O’Reilly title landed in my inbox and immediately answered the first three questions, about installing and dual booting. The book became an instant keeper.

A little later on, I couldn’t find an answer I was looking for, so I was a little less impressed. I got the answer from a friend who teaches Windows 2000, and it was so simple I suppose I should have figured it out myself. (How do you set up a dual-boot system if you’ve already got both operating systems installed and it’s not dual booting? You have to install one of the operating systems from within the other.)

Once everything was installed and operating properly, I found I had to reinstall the modem. It’s one of those software modems, also known as PCI modems. Yes, I know they’re junk and should have been drowned at birth, but it came with the machine and I don’t have time to install the Courier. Besides, I’ll get a cable modem any day now (genuine antique statement) and won’t need it anymore. When I didn’t get any help on this topic from the book, I took away one of its stars.

With those caveats, however, this is a very good book. Quick Fixes, which is trademarked, will apparently be a new O’Reilly series; if so, this is a promising beginning.

The book’s intelligent design helps make it a useful tool. First, the binding is O’Reilly’s durable lay-flat binding, which lets the book lie open when you’re trying something.

And then the text is designed as a series of problems or questions, followed by their solutions, all grouped in logical chapters that progress through the needs you’re likely to have. This makes it easy to find and apply a solution.

Finally, but not by any means least, Jim Boyce—who has written over 40 computer books—writes good, clean, direct text. (Why can’t other publishers find more authors who write as clearly as O’Reilly’s authors do?)

Thus, whether you’ve forgotten your administrator password, you can’t print to an Internet printer, or you want to host an FTP site so other people can download files from your computer, you’ll find clear and simple instructions here.

The book covers both Windows 2000 Professional and Windows 2000 Server, and offers two sets of instructions where appropriate.

Despite not having some information I needed, this book is going on my reference shelf. It disappointed me only because of the high expectations I had after seeing it, and because it’s from O’Reilly. It’s one of the best I’ve seen for helping new Win2K users.
Windows 2000 Quick Fixes
Jim Boyce
O’Reilly & Associates, 2001
ISBN 0-596-00017-0
304 pages, $29.95


Practical Windows 2000 Professional
Review by Tom Anderson

Although the publisher says this is a beginning-intermediate book, it’s really aimed at rank beginners.

The book’s sections cover "Getting Started," "Working with Windows 2000," "Windows 2000 and Hardware," "In the Office," and "Exploring the Internet."

Ed Bott has written a lot of books, was editor of PC World and PC Computing, and has won numerous awards. He’s a talented writer, who can make complicated material clear to the uninitiated, but this book is a poor example of that.

This book focuses on the simple questions, like using Help and clicking on taskbar buttons. If you have almost no computer experience—and I include earlier Windows experience—you’ll probably get a lot from this book. It really does cover a lot of the basics, and in very clear and intelligible style. But if you’ve used any version of Windows before, there’s too much here that you already know.

This book seems aimed at users with very little experience who have to use Windows 2000 at work (if you’re inexperienced enough to need this book, you shouldn’t be using Win2K at home). If that’s your situation, this book will help a lot.

But look for another book—like Windows 2000 Quick Fixes—if you’ve got some experience and just need to answer some questions.
Practical Windows 2000 Professional
Ed Bott
Que Corporation, 2000
ISBN 0-7897-2124-4
514 pages, $24.99

eBlue articles
This page prepared by:

Brian Smither

Copyright © 2000 Sacramento PC Users Group, Inc. All rights reserved.
Read our disclaimer and copyright page for more information.