In April of this year, I participated in a panel discussion for the Java/C++ Special Interest Group of the Technical University of Silicon Valley (formerly the San Francisco Bay Area Center for Advanced Technology). The discussion was held at the offices of Mentor Graphics in San Jose, California. The featured speaker was Herb Schildt, author of numerous computer books, and this event was the first stop of the "Herb Schildt World Tour," or so the T-shirts proclaimed. I was invited as a featured guest panelist because I am also a book author, write this column, and have a long-standing friendship with Herb. What better draw than to have two internationally famous computer luminaries on stage at the same time? I agreed to do it because the deal included an all-expense-paid two-day trip to San Jose and a free Herb Schildt T-shirt. I'm not sure which perquisite was more compelling.
Dr. Dobb's Journal generously covered my expenses for the trip. In line with the magazine's liberal travel policies as established by editor-in-chief Jon Erickson, I flew economy class ("steerage" would be a better description) on the Grace L. Ferguson Airline and Storm Door Company, otherwise known as GLF. I had the usual accommodations at Jim's No-Tell Motel ("$3 for 3 hours, $5 a night") near the airport, conveniently located just under the departure corridor for runway 27, and was afforded unlimited use of the company car -- an orange and black 1972 Plymouth Fury, which was formerly a San Jose taxicab and which DDJ maintains for visiting contributing editors. By "maintains" I don't mean to imply actual maintenance. Jon doesn't fix it. He just keeps it in the parking lot of an abandoned strip mall next to Jim's and leaves the keys in the ignition. The neighborhood notwithstanding, theft has not been a concern.
|
| "I cant' believe I'm on tour with legendary, world-famous author Herb Schildt." |
I was told that Herb's publisher, Osborne Books, was giving Herb the same kind of red carpet treatment that I receive. Publishers like Osborne and DDJ recognize the value of their authors and spare no expense keeping us happy and content.
On the evening of the panel discussion, I got a jumpstart from a fellow patron of Jim's and coaxed the Plymouth, lurching, belching, and smoking, the few miles to the headquarters of Mentor Graphics. As I approached the circular driveway in front of the main entrance to the reception area, I saw a crowd of spectators being held at bay behind ropes by uniformed guards. An assemblage of eager photographers and reporters stood nearby, cameras and microphones poised and at the ready. A video camera was in place to capture the event for the evening news. Obviously, they were all waiting for a first glimpse of the renowned guest speakers -- me and Herb.
Just as I was about to turn into the driveway, a shiny new black stretch limousine cut me off and slid quietly ahead. It glided to a stop in front of the curb by the entrance. The crowd pushed forward in anticipation. Hoping the Plymouth's brakes would hold, I stopped behind the limo and waited and watched.
One of the guards stepped briskly to the rear passenger door of the limo and opened it. A hush fell over the crowd. After what seemed an eternity, a leg clad in designer jeans emerged from the limo, and a designer sneaker hit the pavement with an authoritative thud. The crowd oohed and aahed. Cameras began to flash furiously. The video camera started grinding away. Then it happened. What everyone was waiting for. A beaming Herb Schildt pulled his imposing figure from the limousine and stood on the sidewalk waving to his admirers who were now screaming, "Herb! Herb! Herb!" A young girl fainted. Reporters with microphones pushed forward and began firing questions at Herb. He smiled and waved them off, going instead to the edge of the crowd of spectators who pushed autograph books and copies of his bestseller Teach Yourself Minesweeper at him to sign. Herb graciously took the time and autographed every one before disappearing into the lobby followed by an entourage of aides and assistants who appeared from nowhere to tend his every need.
The limo pulled away and into the VIP parking area. I lurched the Plymouth forward and came to a screeching stop. I looked around for the fans and reporters, but the sidewalk was empty. They had all disappeared into the building, each hoping to get another glimpse of Herb, to overhear some tidbit of Herb's conversation with his staff, perhaps to get a shred of his clothing, a lock of his hair.
A uniformed guard came around to the driver's side of my vehicle and sternly signaled for me to lower the window. The windows don't work in the Plymouth, so I opened the door. The guard jumped back lest the rusty, pockmarked door touch his crisp new uniform.
"What do you want?" he barked.
"I'm Al Stevens," I said importantly, waiting for the spark of recognition that did not come. "I'm speaking here on the panel tonight."
"Oh, yeah? Well, park that heap around back outta sight in the delivery area," he ordered. As I meekly pulled the door shut, he added, "And wouldya come in through the kitchen, please. The guests are starting to show up."
About 50 people attended the panel discussion. Our moderator was Marian Corcoran of the Technical University of Silicon Valley (http://www.centeradv.com/), and many of the attendees were students of the classes she teaches on Java and Internet programming. Mentor Graphics provided a large room with folding chairs set up for the audience and a table and PA system for the panel. DDJ's Philippe Lourier captured the evening, which you can view in its entirety at http://www.ddj .com/technetcast/.
Herb and I were the only panelists. Herb set the tone of the discussion with his opening remarks about "where programming is today, how we got there, and where we are going." He observed that despite attempts over the years to raise levels of abstraction with advanced languages and programming tools, programming seems to be getting harder rather than easier. This opinion evoked much reaction and response from the audience, who mostly agreed with Herb's assertion. We spent the evening discussing levels of abstraction, the increased demand for more complex applications, performance and ease-of-use issues that distinguish C++ and Java, future programming paradigms, the process of language standardization, the problems facing organizations that want to upgrade their applications to Standard C++, and many other such topics.
Herb asked the C++ programmers in the audience how many were aware that Standard C++ specifies header files that are different from traditional C++ and that using those files and the Standard C++ Library has implications. No one in the audience knew about that. Further discussion revealed that none of them are actively looking at or concerned with the issues of Standard C++ as they apply to the software development projects with which the programmers are currently involved. Their interest was raised, however, when we on the panel discussed some of those implications, and they began asking questions about the implications of changing to a conforming compiler.
This pseudopoll that our panel conducted among this small sample of Silicon Valley programmers raised some interesting questions. E-mail from readers of this column indicates to me that DDJ readers are very much aware of these issues, partly because we discuss them here and partly because typical DDJ readers tend, I think, to be interested in issues that might someday affect them. My participation on Usenet groups discussing C++ has also involved contact with correspondents who know a lot about these things. Which group is more typical of the industry? Herb's feeling is that our audience that evening was typical, that 90 percent of C++ programmers are blithely unaware of what's coming, and that those who communicate publicly about such issues naturally tend to comprise the 10 percent who are aware of and concerned about them.
Although much of the panel's discussion with the audience was about Java, I will bypass those discussions here because I am not well qualified to comment on them. Herb has written Java books, and Marian teaches Java. The Java-related opinions of people who know Java well carry more weight than mine (except when someone suggests that Java is better than C++, of course). You may observe the panel on TechNetcast.com and draw your own conclusions about the Java discussions. My sole contribution to that particular topic was to point out the futility of comparing the merits of the two languages in order to declare one of them the superior language. C++ and Java serve different target operating environments. What each does best the other does poorly. I'll stick to the C++ parts of the panel discussion and expand on some subjects that we did not have time to explore in detail.
As we got into the issue of porting a legacy C++ application to Standard C++, Herb and I pointed out, as an example, that the cout object in the global namespace as defined in <iostream.h> is a different object than the new std::cout object as defined in <iostream>. They both have almost identical behavior, in that they write data strings to the standard output device, but they are different objects because they are objects of classes that are implemented differently. Depending on how the compiler implements both libraries, the traditional and the standard, a program might be able to use both headers and both objects. That could happen if you compiled a new source file with standard conventions and linked it with an old object file that was compiled with traditional conventions. That's not a good idea, however. The Standard makes no mention of the old-style headers and the existence of old-style libraries. There is, therefore, no formally sanctioned, universally accepted, standard definition of old-style stuff. It just is what it is.
The problem is further complicated if you try to pass an object of type std::ifstream, for example, to a function that expects an object of type ifstream. The compiler rejects the function call because the types do not match unless the implementor has kindly included a conversion constructor or conversion member function, which is unlikely and certainly not required by the Standard.
One might ask why the committee put everything in the std namespace. The anomalies I just mentioned should help to answer that question. Acknowledging that compiler builders must continue to support traditional, noncompliant libraries for the sake of legacy code, the committee needed a way to insulate the similarly named classes, functions, and objects. That reason also explains why the committee chose a different header naming convention.
Another reason is that, according to namespace proponents, few things in a perfect program are in the global namespace. Certainly, nothing that the compiler system imposes on the programmer other than main should be in the global namespace. Having introduced a namespace feature to support this concept, the committee has to use it. How credible would a feature be if its own creators avoided it?
One might ask why the committee did not use different names for the new classes, functions, and objects. I can only guess at the answer with conjecture as to why I would have made that same decision. As Herb pointed out to the audience, in many cases, a programmer can take an old program, qualify all the names with the std namespace (or use the dreaded and despised std; declaration), change the names of the header files to the new .h-less convention, and recompile. Assuming a properly conforming implementation, the program will usually work. This is not to suggest that you shouldn't run exhaustive tests. You should. But the upgrade is easier and less error-prone than it would be if all the names and the interface were changed.
It won't be that simple with systems of substantial complexity. There is a lot that can go wrong, particularly when a software system depends on legacy libraries that are trusted but not current themselves. Often, the size and complexity of such libraries discourage the programmers from wading in and making broad changes just to accommodate the upgrade. Other times, the source code is not available. My advice is to hang on to the versions of compilers that you used to build working released applications. Make the transition slowly and conservatively. Keep in mind that Standard C++ introduces other small changes in language behavior that can break your code.
One might ask why the committee did not simply codify existing traditional libraries. The first answer is that those old libraries were developed in the absence of a Standard and don't all work alike from implementation to implementation. I learned that when I was writing C++ exercises for my Teach Yourself C++ book (mine, not Herb's). Formatted ostream output worked differently between compilers. The very old C++ conventions sprang from early AT&T implementations of iostreams, which evolved and changed over time. Not all compilers maintained consistency with AT&T's changing conventions. The second answer is that traditional iostreams do not support a wide-character format and are unsuitable for international data representation. The ISO half of ANSI/ISO would not have stood for it.
The panel discussion was a huge success, and we all had a great time. When Marian brought the session to a close, Herb's admirers crowded around him for some one-on-one. Mostly ignored, I hung back with some of his entourage and chatted about the Bay Area weather, which was rotten that day. A young man in a black suit (the only suit and tie in the room) wheeled in a dolly with a load of books and a cash register for the official Herb Schildt book sale and signing session. I asked the Osborne people if the guy in the suit was the limo driver; he certainly looked the part. Certainly not, they told me, he is the publisher. Oops.
I stayed until all the books were sold and signed and all the fans and reporters had left. Herb and I said our farewells, and he and the driver, er, publisher grandly led the entourage out to the limo for the champagne celebration ride back to Berkeley. I thought about the Plymouth and wondered where I could get another jumpstart that time of night. I took one last look around at the abandoned meeting room and started out toward the rear parking lot where the Plymouth waited in exile. The uniformed guard stopped me at the door.
"Where do you think you're goin'?" he demanded to know.
"Back to the motel," I answered sheepishly. "I've got an early flight. GLF doesn't fly at night."
"Oh no you don't," he snapped. "You're not goin' anywhere. Somebody's gotta fold up all these chairs and put 'em away."
DDJ