Carl Tashian

April 2002

« November 2001 | Main | June 2003 »

11 Apr 02002

There are the casual users and there are the hackers. The casual users use their computer as a tool, and they don’t care how it works. The hackers, on the other hand, are fascinated by the technology and want to know what’s going on inside.

I’ve found that most things in science are divided into layers. It’s as though we’re making a pie. The crust is the lowest layer, and the ice cream on top is the highest. Each layer relies on the ones below it.

Layers (some people call them “layers of abstraction”) are a way of looking at a system that makes it easier to design and analyze. You can look at one layer by itself and see how it works relative to all the others.

The best example I know if is in computer networking. There’s a cable connecting your computer to other computers. It represents the lowest layer of the networking model. Your web browser represents the highest layer. If you want to write a web browser, you don’t need to learn how information gets send through the cable. Nor do you care—the cable could be made of copper, glass fibers, or any other material, and your web browser would still operate the same way.

The same concept applies to programming languages. If you’re writing a program in a “high level” programming language (we might as well call it “high layer”), you don’t need to know what the computer does to your program when you run it though your high level compiler (say, Visual C++).

Cross-platform

Everyone, even Microsoft, has persued the idea of cross platform software for a number of years now. Wouldn’t it be nice if I could have a program that ran on whatever computer I wanted it to run on? From my Pentium-based machine, I could throw the program on a disk. Then I hike over to my friend’s house and run it on his Macintosh. This idea drove Sun Microsystems to develop the Java programming language. The idea is that software written in Java will run on any computer, and it will generally look and act the same. Pretty nice, huh?

I see a lot of books about Java in my local bookstore, but while it has become a hyped up industry buzzword, I don’t see many companies moving to it. I came up with a couple reasons for this appearant lack of acceptance.

First, it takes a lot of time and money to switch to a different programming language, especially for a company with established pieces of software. Training people on a new language, buying all of the necessary tools to use the language, and converting what has already been written successfully in one language to another are all costly to a company. It’s like retooling the factory.

Second, companies who release a program on multiple platforms already have their software written that way. Take Netscape Navigator, for example. In 1998, Netscape released the source code for their Navigator product to the public. On briefly examining it, I found that they divide the code into two major parts: front-end (FE) and cross-platform (XP). The FE code is different for Windows, MacOS, and UNIX. It is dependent on the operating system. The XP code, on the other hand, doesn’t depend on anything specific to the operating system. It works just as well under Windows as it does on UNIX. (and it’s yet another example of layering: The FE code is the highest layer (and it’s interchangeable), and the XP code is the lowest)

Now, if I wanted to add a new feature to the front end of Netscape, I would have to figure out how to write that feature for each operating system that Netscape is made for. If it were written in Java, however, I’d only have to write the code once. The Java interpreter on each operating system knows how to do all of the OS-specific functions.