Letters

Dr. Dobb's Journal August 2001

Huge GCC Executables

Dear DDJ,

Somewhere in an old DDJ column, Al Stevens noted how big GCC-produced executables can be — up to 1.6 MB for a simple "Hello World!" compiled with the Standard C++! I found this statement on the Cygwin FAQ (http://sources.redhat.com/cygwin/faq/faq.html#SEC77): "By default, GCC compiles in all symbols [...]. If that bothers you, just use the 'strip' program, part of the binutils package. Or compile with the '-s' option to gcc."

I guess that this behavior's purpose is to let you identify in which function a program crashed just by loading a coredump in a debugger. I don't know if this is linked to the extreme sizes that you noted, but I suspect that it is.

Paolo Bonzini

bonzi@pc-amo3.elet.polimi.it

Java Class Loader

Dear DDJ,

Thanks for including an article on class loaders, "A Java 2 Network Class Loader," by Lorenzo Bettini and Donato Cappetta (DDJ, February 2001). Class loaders are fundamental to understanding Java, and are all too often ignored in intro-level materials.

Readers should note that Java does include a built-in network class loader, java.net.URLClassLoader, so there is no need to write your own. Also, the built-in URL and URLClassLoader classes let you separate the two key tasks performed by most class loaders: resource resolution and security. The URL class permits pluggable protocol handlers, which abstract away the details of network connection, as discussed in Brian Maso's article "A New Era for Java Protocol Handlers" (http://developer.java.sun.com/ developer/onlineTraining/protocolhandlers/). The URLClassLoader extends SecureClassLoader, which associates property permissions with class loaders. SecureClassLoader is the backbone of Java security. However, if you extend ClassLoader instead, as the code in the article did, the entire security architecture goes out the window. Finally, the article's NetworkClassLoader is insecure, and is a poor abstraction of resource resolution when compared to the classes that are already part of the core API. Readers should view the NetworkClassLoader as an educational example, not as a recommendation for how to write or use class loaders in any production environment.

Stuart Halloway

http://staff.develop.com/halloway/

Department of Dumb Ideas

Dear DDJ,

Here's one for your department of dumb ideas. In its online catalog (http://www .radioshack.com/product.asp?catalog%5 Fname=CTLG&category%5Fname=CTLG%5F002%5F003%5F018%5F000&product%5Fid=33%2D2055), Radio Shack is selling a digital VU meter. However, the picture in the catalog shows the case, not the meter.

John Penry

jpenry@satx.rr.com

Setting the Record Straight

Dear DDJ,

Richard Stallman would receive far more sympathy and positive response if he were more courteous and polite (see "Letters," DDJ, April 2001). As it is, most of the comments, though valid, are simply ignored by the community at large.

The operating system popularly referred to as "Linux" will never be called "GNU/Linux." Get over it, RMS. For as much as Linux is no OS without GNU, GNU is no OS without a kernel, and HURD is still a ways off. Furthermore, it was the Linux kernel that drew the large crowd of users, not GNU. Linux was the project that essentially sparked the "Bazaar" model of development, leveraging the Internet and a large community of developers to rapidly improve and enhance itself. While GNU is an extremely laudable effort, its development was much more controlled until recently. Thus, more people associate the entire GNU/Linux system with the Linux kernel and the Open-Source philosophy than with the GNU operating-system software and the Free Software Foundation and its ideology.

Berating people's intelligence also doesn't further your cause, nor does declaring projects "problems" as you did with KDE due to its dependence on Trolltech's QT under the previous, more restrictive license.

I respect your abilities, and understand — though I disagree markedly — with your philosophies. I also disagree with the continuous, bigoted insistence of adherents of both Free Software and Open Source to characterize other operating systems as inferior and their manufacturers as evil. These operating systems possess strengths that neither GNU nor Linux have, and fulfill needs that their Free or Open counterparts can't.

Oluseyi Sonaiya

oluseyi@twcny.rr.com

The Legacy of C#

Dear DDJ,

After reading Marc Eaddy's article "C# versus Java" (DDJ, February 2001), it is interesting to note that Microsoft is taking a page from IBM's mainframe Common Language Environment that supports all the programming languages on the IBM mainframe OS, such as OS/390. All the IBM compilers use the APIs that are in the CLE and so produce the same results. IBM has addressed the interoperability problems quite nicely. Perhaps Microsoft can be successful in CLR.

As for cross-language rather than cross-platform, perhaps Microsoft should take another leaf from IBM's notebook. I doubt that will ever happen, however, as Microsoft's business model is to sell software in a monopoly environment, where only it sells the software. Microsoft is completely dependent on Windows. Microsoft sees no reason to dilute its monopoly by entering other platform markets. It had no success with Windows NT on the DEC Alpha platform (now Compaq).

Microsoft has been predatory in its take overs of software such as Kerberos. That security software is now fractured and the promise of cross-platform security is dead as far as connecting Kerberos on Windows to any other implementation, due to Microsoft making a Windows-specific modification.

Without a monopoly on the Internet and on Java, Microsoft will not grow. The momentum is building in the open OS arena with Linux and Java for cross-platform development. IBM is investing US$1B in Linux development. It has already invested a lot in Java on all its platforms. Where Microsoft is single platform, cross language, IBM is multiplatform single language. IBM's business model is based on its hardware sales, and it could care less whose software runs on IBM's hardware. It is obvious that Microsoft and IBM are at odds in the business arena. Microsoft's success with Windows and the extension of Windows-dependent software to the Internet and enterprise is to the detriment of IBM.

In a way, I'm in favor of C#. I can add yet another language to my résumé and another certification to the list I have, and presumably that makes me a more valuable resource for the job market. On the other hand, I'm paid for success, and the most stable platforms for large enterprise systems of applications are not Windows. I must also contend with interfacing with legacy systems, and the cross-platform approach is where established enterprise data processing solutions succeed best.

Bruce E. Hogman

bruce.hogman@eds.com

DHTML Source-Code Correction

Dear DDJ,

Both DDJ and DDJ.com are good resources for the programming community. I particularly enjoyed the February 2001 issue, especially the excellent article "Cross-Platform DHTML" by Charlie Ma. However, there is a typo in Listing Two (page 128 in the magazine) that prevents the samples from running. The "x" on the last line of the excerpt below (after the "+" and before the "='") is extraneous and stops the code from executing properly.

<! — StartFragment — >

if (obj.nodeType == 1) {

// nodeType==1 for all HTML tags other than comments and CDATA.

msg += "&lt;" + obj.nodeName;

for (var j=0; j<obj.attributes.length; j++) {

if (obj.attributes.item(j).nodeValue) {

msg += " " + obj.attributes.item(j).nodeName

+ x"='" + obj.attributes[j].nodeValue + "'";

<! — EndFragment — >

I learned a lot from the article and the samples are cool.

Greg Bissell

gerui@artofchina.com

Shared Libraries Aren't All Bad

Dear DDJ,

Okay, I'll be the first to admit that it's bad form to reply to a reply to a response. However, I feel a slight twinge of moral imperative to reply to Jeff Duntemann's reply to Michael Wojcik's response to Jeff's original assertion that "[t]he worst idea ever to arise in the history of computing is shared code libraries" ("Letters," DDJ, March 2001). Two things need to be sharply pointed out. First, I feel that Jeff is obliged at the very least to admit that his original statement was far too broadly stated. After reading his reply, it seems that what he really meant to say is that the worst idea ever to arise in the history of computing is Windows' implementation of shared code libraries. Second, the conservation of disk and memory space is only 20 percent of the issue, if that much. To say that we should get rid of this concept of shared code libraries is like saying that we should get rid of this concept of subroutines; after all, any modern editor can perform a copy-and-paste in a jiff. Any programmer who has been too liberal with copying-and-pasting will quickly learn the error of his ways as soon as he discovers a bug in one of those lines of code.

Michael Hobbs

hobbs1@acm.org

Zuse and Intel

Dear DDJ,

In his recent "Letter" (DDJ, December 2000), Oleg Kiselyov points out that Intel's excitement over the "advance" of predicated execution is inappropriate, as it was massively predated by Zuse. Well, Intel may be forgiven for not being aware of the inner workings of Zuse, but if they are unaware that Acorn's ARM chip had this feature more than a decade ago, they're even more stupid than they are arrogant.

Ben Laurie

ben@algroup.co.uk

DDJ