Software Development, Linux, and the White House

Dr. Dobb's Journal March 2001

By Al Stevens

Al is DDJ's senior contributing editor. He can be contacted at astevens@ddj.com.

I'm writing this column in December. It's late but I wanted to be able to say something definite about the election. Blame it on the short count. About six weeks ago, well before the Presidential election, when we were still under the blanket of political innocence, I attended Software Development East in my home town, Washington, DC.

Judy and I traveled north in the DobbsMobile, but left it parked in the Virginia suburbs. DC parking can't accommodate a 37-foot motorhome, you see. We stayed in the Marriot hotel at 14th Street and Pennsylvania Avenue NW, two blocks from the White House and a short walk from the monuments, the Capital, and the Smithsonian Institution. Judy could be a tourist while I attended the conference. 14th and Pennsylvania also happens to be where I had my very first musical engagement 42 years ago. In 1958 a restaurant and bar named "Bassin's" occupied that corner. The basement lounge at Bassin's was called "L'Escapade," a dark, dank French-style bistro with candles in wine bottles on checkered tablecloths, cocktail waitresses in net stockings, short skirts and berets, and an ornate upright piano with a glass front and luminescent, black-light illuminated hammers and action. I was fresh out of high school and had a gig there playing stride and ragtime piano. The lounge at the Marriot is the typical upscale business class watering hole, a far cry from the dingy charm of L'Escapade, which years before gave way to the higher demands of such a choice real estate location.

Coincidentally, the new Mariott lounge features a pianist, and quite coincidentally he turned out to be an old friend of mine. We spent the evening hours sitting in that lounge during his breaks playing the old-timer's game, "whatever happened to whatshisname."

The first night in town was Sunday, and Judy and I went for a long walk to Dupont Circle and back. It was cool, and we walked at a brisk pace, enjoying the sounds and sights of the city at night when it's not so busy doing the business of government. On the way back we looked for some place to eat. I wanted to find a small, quaint out-of-the way cafe but few such places are open on Sunday night, so we kept walking, figuring we could always do room service if nothing better presented itself. Then, about three blocks from the White House, we came across a small joint with a menu on the door and an "Open" sign. You couldn't see inside, but the menu looked inviting, so we went in. It was a long narrow space with a bar running lengthwise and loud music coming from the other end of the room. Judy picked a spot at the end of the bar nearest the door so we'd be as far as possible from smokers and the noise. Two guys were sitting together about halfway down the bar. When they saw us come in one of them nudged the other and they started snickering and watching us. Uh, oh, I thought. I stretched and looked past them to a mirror that reflected the doings at the far end of the room. That's when I saw the reflection of a lovely young lady who was on a riser gripping a vertical pole and undulating to the music. She had neglected to dress for her performance. When the two guys saw that I saw, they broke out laughing. Judy was impervious to it all, busying herself taking off her coat, carefully hanging it over the back of the barstool, and fixing us a place at the end of the bar. I shrugged my shoulders for the benefit of the two amused patrons, leaned towards Judy and said, "Judy, this is a topless bar." (Actually, I didn't say "topless." I used another term that means the same thing, but Judy says I may not repeat it here.) Judy jumped off the bar stool, had her coat on in record time, and said, "That's it, we're outta here!" The two guys had their heads down on the bar, they were laughing so hard. I pleaded, "Couldn't we just stay and eat? I'm hungry and you can't see much from here," as I craned my neck for a better look past the patrons to the runway. Next thing I knew, Judy had me by the ear and we were headed for the door. The two guys roared and pounded their hands on the bar.

As we exited I noticed a quiet figure seated in the shadows in a booth. I could barely make out his silhouette but he was a familiar looking figure, nice-looking, tall, slightly overweight, with an abundance of wavy gray hair. A saxophone case was on the floor next to him. He didn't notice us as he divided his attention between the exotic entertainment and the Help Wanted section of the Washington Post. Just another out-of-work musician, I figured until I saw the pair of secret service agents standing nearby. As we came out into the night, I looked down the street towards the White House. The lights were out in the residence.

A Voter's Lament

By now you've heard every thing that everyone has to say about the election, and there isn't much to be added. My sentiments are with Justice John Paul Stevens, who, besides having a noble name is also blessed with much wisdom. He nailed it full square when he observed in his dissenting opinion that whereas we'll never know who really ought to be president, there is one sure loser — the confidence that people once had in a would-be, should-be objective judiciary.

I'm a Floridian, and we've gotten used to being blamed for the whole mess. You can be sure, however, that similar problems exist in all states, counties, and precincts. Florida was unlucky enough to have the combination of the deciding electorates, a very close count, and discrepancies in counties that could otherwise be expected to favor the loser. The whole episode clearly illustrates that our nation's methods of voting are inaccurate and error-prone, but that no one really worries about it when one side or the other has a commanding lead. That MIT and CalTech are teaming up to build an accurate — presumably computer-based — voting machine brings some comfort.

In case you think this situation has nothing to do with programming, consider this. During the whole shebang, we were constantly shown varying formats, machines, and procedures in use throughout the country for voting and counting votes. Every now and then the media paid brief attention to an experimental automated system with which voters cast their ballots on the Internet. They claimed to have tested the system this year in some unimportant local elections. I don't know what kind of mechanisms they have in mind to ensure the security and integrity of such a process, but I wonder why no one took notice of an odd coincidence. Just a few months ago, the networks of Microsoft, the world's undisputed leading technology company, were invaded and compromised. If Microsoft can't protect a vital digital resource, the source code to Windows, from the prying eyes of intruders, what makes anyone think that the Internet could be trusted as a safe medium for the registration, collection, verification, and tabulation of a free nation's most precious resource, the will of its people?

Software Development East

Each year the east coast edition of the Software Development conference gets smaller reflecting the growing number of conferences, which dilutes the marketing budgets of folks who show their wares and the admission budgets of potential attendees. The theme of this year's conference was expressed in its motto, "Go Further." My first reaction as a wordsmith was, go further what?

XML

Speaker and author Elliotte Rusty Harold conducted several sessions on XML, and I was able to attend one of them. I am interested in XML because folks are saying it's the next big deal in data formats. I know a lot about SGML, its ancestor, because I worked on an SGML editor for a client several years ago. Everybody knows a lot about HTML, which purports to be a hybrid subset of SGML. XML is a good solution to some of the problems of SGML, or so I've surmised from reading a couple of books about it and it stands to improve HTML, too.

I wanted to learn more about the potential they claim for XML to be a generic database format. Certainly XML markup tags could represent the row and column characteristics of a relational database, and an XML Document Type Definition could describe the tabular schema of such a database, but I foresee some implementation problems. An XML document consists of people-readable text. To implement the primary and secondary keys necessary for associative access and inter-file relationships, a database needs fast-access inverted indexes, which are typically not text. Indexes that refer to records within a database need a flat file structure and fixed-length record structure or something that points to record positions. Efficient record insertion and deletion require fixed length records or a system of chained file space allocation and deallocation. Nothing in raw XML supports these things. One of Harold's sessions addressed XML as a schema language, but a scheduling conflict prevented me from attending. (It was my only chance to sneak back to that restaurant near the White House for lunch and diversion while Judy was cruising the museums.) I figured I could get the information from his book, XML Bible (IDG Books, 1999) but the book does not cover XML schemas, which is apparently a fairly new idea. Microsoft has endorsed XML as the format for information exchange in its .NET platform, so we should all come to know XML better — assuming Microsoft's plans to dominate the Internet succeed. (They could hire its inventor. I understand he's looking for a job, too.) I still don't know how XML can be a database format, but I suppose it will become evident soon enough.

Go further XML.

Software Regulation

Richard Hale Shaw conducted a panel session titled, "Should Government Regulate the Software Industry?" This session reflected reactions to the government's antitrust case against Microsoft and the judge's ruling that Microsoft should be broken up. The panel consisted of industry representatives reflecting various attitudes about the question. It seemed to be divided between supporters of Microsoft's way of doing business and those who opposed Microsoft.

The bigger question, however, goes beyond the Microsoft case, which I discussed last month. First, regulation and antitrust suits are two different things. The former establishes and enforces regulations — a regulatory function; the latter examines business practices and determines if laws have been broken and penalties need to be imposed — a judicial function.

One must first ask what should the government regulate. Certainly we want them to keep an eye on things that need regulation but cannot be managed at a local level. Air traffic control, interstate commerce, national security, and so on. But government regulation of some specific industries turns out not to work. Gasoline price regulation was a bust. So was air fare regulation. My answer to the original question is that government should not impose regulation on the software industry beyond what is already in place for other industries.

Go further free enterprise.

If the government's antitrust suit against Microsoft interests you, I recommend the book, U.S. V. Microsoft, by Joel Brinkley and Steve Lohr (McGraw-Hill, 2001). Brinkley and Lohr, reporters for the New York Times, covered "every minute of the trial, gavel to gavel," and interviewed most of the main players. Their book is a chronological compilation of related Times articles with retrospective sidebars inserted by the authors. This book contains a lot of repetition because daily newspaper articles must include some background information, assuming a reader is new to the subject. I can't tell how many times the book reports that Judge Jackson heard the case alone without a jury. After a while, the repetition becomes tiresome, but if you stick with it, you'll be rewarded with comprehensive coverage of the event from the perspective of the authors, and you'll better understand the case against Microsoft and the amazingly inept defense it presented.

C++ Style

There were two sessions that addressed C++ coding style by C++ lecturer Dan Saks and C++ author Stephen Dewhurst. Dan and Stephen discussed similar style issues, agreed on some points and disagreed on others.

Neither one talked much about indenting style and brace placement, a major style issue with me. Programmers really differ a lot about where to put braces and how to indent. Compare the classic K&R style that many of us learned with code examples that come with compilers or from the open source community. I find some versions of STL particularly difficult to read when the programmer's preferences for brace placement differs drastically from my own. Templates can be hard to read even when the style is your own.

Go further stylish C++.

C#

Dan conducted an after-hours "birds of a feather" session titled, "What is C#? Does Anybody Care?" Dan moderated the session, mostly trolling for opinions. Off line, he expressed his own thoughts about how well the C# language is designed, pointing out inconsistencies in the naming of things such as C# type names, indicating either a hasty design or a design team that deemphasizes aesthetics and balance in a programming language.

Dan asked for opinions and attitudes of programmers about whether anyone needs another programming language and, if so, whether C# fills the bill. I think the answer becomes obvious once you start bantering it about. Microsoft does not control Java. Microsoft can't extend or modify Java without getting sued. Apparently Java does not support everything Microsoft has in mind for .NET. Therefore, Microsoft needs C#. I'm not sure anyone else does. Neither were most of the attendees of this session.

Microsoft, go further yourself.

By the way, C++ author Mark Nelson, who participated in this discussion, e-mailed me later about the 26 Down entry in the New York Times Crossword Puzzle on November 27. The clue? "C sharp." The answer? "D Flat." Mark's comment: "When the paper of record takes notice of this controversy, you can truly say you have arrived." Old-timers to this column will appreciate the irony.

Changing Platforms Midstream

Last month, I mixed my metaphors and announced I was changing soapboxes midstream with respect to my opinions about the Microsoft breakup. This month I'm carrying that rant further and adding a metaphor to the mix with the announcement that I'm working on a change of platforms, too, from Win whatever to Linux.

I decided to explore this jump not because of my reaction to the Microsoft monopoly, not because Linux is open source, not because of the never-ending debate about what's best for programmers or whether Windows or Linux are truly real operating systems. No, I decided to make the switch after I bought a new computer. Actually, after I bought three new computers.

A couple of months ago, I told you about buying a new 1-GHz Compaq computer that didn't work, and which I returned to Sam's WalMart outlet. A couple of weeks ago, I ordered a Gateway computer from QVC. It was dead on arrival. Wouldn't power up. I called Gateway tech support, explained the problem, and opined that the power supply might be kaput. The tech support person agreed and suggested I call back in a few hours to get Gateway to send me a new power supply. Why a few hours, I asked. Their computers were down, he said. Now there's a confidence-inspiring revelation. Since we never determined that it really was the power supply, since I had just purchased a computer no one had ever turned on much less burned in, and since the system unit did not have the usual plastic wrap, which indicates someone else had purchased and returned it, I called QVC and arranged a cheerful pickup, return, and refund. I still didn't have my new computer.

Trips to Best Buy, Office Depot, Staples, and Circuit City revealed many new computers from which to select, but no one who could answer questions. How many expansions slots? Any ISA slots? Can I expand memory and use the present chips? Is 1-GHz on an Athlon as fast as 800-MHz on a P-III? Will the IDE cable support another hard drive? Are there sufficient IRQs to add my old network card alongside the new one? How fast are the DVD and CD/RW drives when you use them as CD-ROM drives? And so on. The salespersons knew the prices and where the boxes were, and little more. Then I went to CompUSA and found someone over the age of 15 who knows about those things. (Why are you working here? I asked. I'm a retired programmer, he said, and I wanted something to do. Someone who talks my language, I thought gratefully.) I bought an HP thingie from him with a 933-MHz Pentium III and told him as I checked out, "If there's one in your inventory that doesn't work, this is it. That's the kind of luck I have." He laughed. I brought it home and hooked it up. The CD/RW drive didn't work and the speakers made loud annoying static noises. HP units are easy to service — two thumbscrews provide access to the innards. The CD/RW's power cable had fallen out, and one of the sound card's cables had a bare spot that was touching the chassis. Unit fixed.

Now, how did this new computer point me to Linux land? Easy. It came with Windows ME installed. What a fascist OS! It keeps popping-up unexpected windows telling me to do something. My two choices are "do it now" or "be reminded later." No way to say, "I DON"T EVER WANT TO DO IT! STOP ANNOYING ME!" It keeps wanting me to be connected to the Internet. It keeps wanting me to use applications it wants me to use. It keeps popping-up this obnoxious little cartoon icon that tries to be cute and tell me stuff I don't care about.

Plus, they moved a lot of stuff around. It took me three days to find the Dialup Networking and Printers applets that used to be in My Computer. Now they're in the Settings menu. Why? What was wrong with where they used to be? Who decides stuff like this?

Worst of all, ME has taken away some important capabilities without getting my permission. For example, the MIDI Mapper applet is gone from the control panel. At least I think it's gone. I haven't found it if they moved it. Some applications depend on it if you are a serious MIDI user. One of them is the Windows MediaPlayer. Two others are Midifitz and Jukebox, creations of mine that I featured in this column in years past. If I'm to use ME I'll have to write a MIDI Mapper applet to replace the one that went away.

Linux Deluxe Redux

Being an in-control kind of guy, I decided I want more control. So, why Linux? Well, everything important about Linux and its applications is open source, which means I can fix or change whatever I don't like, and if I can't find something in the documentation, I can read the source code to see how it works. Furthermore, Linux is way behind Windows in its evolution towards being completely for dummies. Being a real, hairy-chested, he-man programmer, I like getting closer to the metal and as far from the candy-coated user-pampering glitz as possible.

For another reason, I'm bored with Win32 programming, so much so that I've started calling it Lose32. When you start making fun of your platform and calling it names, it's time for a switch.

Does this mean I've totally abandoned Windows? Unfortunately, no. I have to continue to support Quincy 2000 for people who are using it, and I have several specialty applications that I developed under Windows that I have to use until and if I get them ported to Linux. I'm also a devoted user of Cakewalk, Band In A Box, and several graphical and desktop publishing packages, and until I find suitable substitutes that run under Linux, they remain my Lose32 compelling applications.

Hope is on the horizon, though. I did some research into what's available under Linux for programmers, writers, and musicians, because I am one of each of them. What I found so far is encouraging.

Linux Music and Sound, by Dave Phillips (Linux Journal Press, 2000) documents a host of musical applications — MIDI, audio, notation, and so on — that run under Linux. The book is simply a small user's guide for each of the applications it describes, and the choices are impressive.

My primary purpose, however, is software development, and that's what will drive and motivate how I proceed.

GNOME versus KDE?

My first major decision as a developer is between KDE and Gnome, two competing graphical operating environments — not the only ones, but the most prominent. Users can use either one or both, but programmers need to pick one to develop for, learning curves being what they are. I've already made my choice based on a first cursory examination of both, but I'm wide open to persuasion.

My choice, KDE, is not based on any of the rhetoric, debate, and hyperbole circulating the net about these two packages. That stuff is all about turf wars and social agendas. My choice is not based on trying either package either, because I haven't yet installed Linux much less the packages to evaluate and compare them. My choice is based on the books I have read so far.

Writing GNOME Applications, by John R. Sheets (Addison-Wesley, 2001) teaches how to use the GNOME API. From this book, I concluded that GNOME is heavily C-centric, relying on its underlying C libraries, GTK,+ and GLib. GNOME uses GLib container library functions where a C++ programmer would use STL. GNOME uses identifier naming conventions where a C++ programmer would use namespaces. It tries to look object-oriented in a language that does not support object-oriented programming. All this, of course, is because GNOME is a C library in sore need, in my opinion, of a comprehensive C++ wrapper. GNOME application development uses traditional command line tools, too, and does not include a GUI integrated development environment.

Some time ago, I began design on an improved Lose32 GUI C++ application framework, which I was going to name D-Flat 2000 and which would use a free compiler and contemporary features of Standard C++. I abandoned the design when I realized that no compliant free compiler for the Lose32 platform was available, and I was just reinventing MFC. When I began looking into Linux development, I thought that GNOME C++ class wrappers could be what was to have been D-Flat 2000, and a Quincy-like IDE would also be a worthy projects to undertake. Then I read about KDE.

KDE Bible, by David Nash (IDG Books, 2000), is a user's guide to the KDE desktop and applications. If you are a Windows user you'll find a lot about KDE to be comfortable with. One of my requirements is for a multimonitor operating environment, something that Windows does very well, and something that KDE does not seem to support. But, then, it's open source and if this desirable feature is not out there somewhere, somebody is bound to do it eventually. Hint, hint.

Linux Rapid Application Development, by Cameron Hughes and Tracey Hughes (M&T Books, 2000), teaches programming using the KDE application framework class library. I'm still reading this book, but first impressions are that KDE already has what GNOME seems to be missing — a C++ class library application framework and a GUI integrated development environment.

My conclusions are preliminary and my opinions flexible, so I welcome the opinions of others and recommendations for other things to read. But if my conclusions turn out to be accurate, by choosing KDE I can skip building a C++ development environment, as much fun as that might be, and begin porting old applications and developing new ones several years sooner. Duh?

DDJ