Using a Hammer to Cut Wood
By Bruce Johnson
12 December 2001

horizontal rule

Have you noticed something about the technology world, and the software world in particular? That is that every technology which is good at one thing is continually used for other things, until it gains a bad reputation.

For example, I was reading a story by Joel Spolsky the other day, and he mentioned that in his program (CitiDesk) he chose not to use XML to store his data. Rather he used a relational database. And he was defending that decision. He claimed it would be too slow.

Mentally I immediately agreed with his point. Actually the thought of using native XML to store database information had never crossed my mind. It’s an intriguing concept. For day to day tasks, the longer I think about it the more absurd it sounds.

Of course XML is not bad. I took some convincing, but now I personally think that XML is a fantastic format for moving data between 2 different programs. It’s sufficiently flexible, yet also sufficiently well defined so that programmers on both ends can make it work. It’s even a reasonably good file format for something like a word processing document. After all it allows all word processors to share the same basic format, and yet at the same time extend it to support their features. Users typically load a file, then edit it, then save it, so overall disk performance is not a major issue. Size of the file is not an issue. But as a database file it would be terrible. All the things that make database files fast don’t work well in XML. Random-access reading and writing of the file, along with indexes and so on simply don’t work in text based systems. And with large volumes of information one thing matters most. Speed. Running a close second is size. Another thing that XML is no good at.

Elsewhere in the article Joel mentioned not using a browser for his interface. Rather he wrote a normal Windows program, with a normal windows program interface. Again he had to spend some time defending the decision. After all in these modern times Browsers and XML are all the rage.

But let’s be honest. Browsers are terrible interfaces for programs. Browsers were designed to move information.

"The dream behind the Web is of a common information space in which we communicate by sharing information" - Tim Berners-Lee, The World Wide Web: A very short personal history

In a nutshell the idea is that the document is separated from the display. So you could make a browser for a PC, a Mac, Unix, Palmtops – even a Dick Tracy watch if that’s what inspires you. From any of these devices you could read from a global pool of documents, using the layout and fonts etc that best suited your device.

Well, if that was the specification for the WWW, and therefore for Browsers, then they’ve performed fantastically well. Certainly no respectable platform is without one. They are everywhere, and no matter where you are you can read simple HTML documents as Tim Berners-Lee first intended.

But of course the world wanted more from their browser. They wanted graphics. And Javascript. And Java applets. And Flash. And Forms. And so on… And so the phrases "Best viewed with Netscape 9.9", "Best viewed at a resolution of 1024 x 768", "Requires Internet Explorer 32.6" are born. Somewhere along the line the portability goal got lost.  Indeed somewhere along the line the whole point got lost. What's the web today? To most users it's nothing more that a commercial opportunity.

So the browser is all the rage, and investors are asking “Can we run this program in a Browser?” And too many people said “yes”. When the answer should have been “no”. A browser is a terrible program interface. No menus (except for the browser one’s which have nothing to do with the program.) No control over where things are placed (unless you resort to hacks with invisible tables.) Very little feedback along the way. Every programming task in a browser window is basically a hack. Plus what’s the most expensive part of any network? The bandwidth. So what does the browser do about it? Well it’s about the most inefficient model, bandwidth wise, that exists. 

So what was the solution? Find an answer like ClarioNet, Citrix or Terminal Server? No the answer was to extend HTML, extend the browser, do whatever you can to make it work. And what do we end up with? A slow dog of a program, that still displays simple HTML very well, but varies from mediocre to poor at other tasks. And is an absolute bandwidth hog.

Now any programmer in the world will tell you that the browser is a horrible environment to program in. The acid test goes something like this. “You have to write an accounting system that will run locally on a PC, with a local hard drive.” Would you prefer to write this in VB / Clarion / Delphi / Java et al or in a Browser? (Bear in mind that even if you said Java the question would still be inside, or outside, the browser?) You’d have to be loony to pick the browser. Why give up the richness of the OS’s API and restrict yourself to the kindergarten environment that the browser offers?

Foul you cry! The browser can do more! It can run it remotely! Sure it can. The point is though, in this case we don’t want to run it remotely. What about multi-platform!? Again unless you have a very good reason for multi-platform, then this shouldn’t be a goal. 

And even if these items are required, is the browser the best solution? I suggest that the browser is almost never the best solution. It should be the last option, the one taken when everything else is eliminated. Sure there are time when it is the best solution. B2C commerce where you are attempting to attract the unclean masses. Even in B2B commerce though, if you have a finite number of clients, then you may be better off with other alternatives.

What about operating systems. It’s more of the same. Windows rules the desktop. So what do Microsoft do? They start turning it into a Server. Unix (Linux et al) is a great server? So what’s the natural inclination? Make it a workstation. What’s the result? Linux is still a crappy work-station. It simply lacks the maturity, and application support that Windows has. (Maybe it will get there, that's a topic for a separate article - all I know is that it's not there yet...) Windows on the other hand, at best, makes an Ok server. Sure it makes things much easier (and somehow more frustrating at the same time), but security and speed are not 2 things it’ll win prizes for.

The one question I want to know is why? After all a tool box by definition holds tools. Not just one tool. You can’t use a hammer to cut wood, and beating in a nail with a saw is a waste of time. Yet in the computer world we’re search for something to do both. And we often fail to do either particularly well.

Unfortunately good sense never stopped the hype. I wouldn’t know, but I bet even now someone is building an RDBMS engine on XML – or trying to anyway. And the browser will continually be extended, but not improved. 

It seems the computer world is searching for that holy grail – the perfect hardware, or software, that will be all things to all people all the time. And perhaps the one thing we can say about that tool is that it hasn't arrived yet.

 The successful folks though seem to be the ones quietly getting on with the job, using the right tool for the right task.

horizontal rule

Disclaimer : This article is the opinion of the author, and is not necessarily the opinion of any other person or company.
Specifically it may not be the opinion of the owners, or host, of this site.

© 2012 CapeSoft Software