Awasu » Laziness as a virtue
Tuesday 24th August 2004 1:33 PM [General]

Continuing a trend, I've been ploughing through yet another book, John McWhorter's "The Power of Babel" (it's somewhat related to the project I'm working on now so it's not like it's been all for fun :-)). It's an intriguing study on how languages have evolved, merged, diverged and generally mutated over the millennia into the six thousand we have now (an astounding number given that we currently only have some 190-odd countries).

Anyway, it got me thinking about this article which I came across last year but it's such a good one, it's worth revisiting. It tries to envisage what programming languages might look like one hundred years from now.

NOTE: Non-technical people may find this post somewhat boring and/or incomprehensible so you may want to make use of that most heinous of programming constructs and goto the last paragraph.

There are a huge number of programming languages around now, each one supposedly designed to solve different issues yet there has been an enormous amount of influence and cross-pollination between them all.

I'm a C programmer from way back (actually, assembly language from even way back-er) and well aware of the evolutionary changes that took place as it mutated into C++. For someone starting out with C++ (rather than C), there are some things that seem weird, incomprehensible or just plain wrong and you need to know the historical context in which those design decisions were made. Some of them were justified but some of them indeed turned out to be just plain wrong 🙂 Even the name itself has a history. C was begat by a language called B which was begat by a language called BCPL and so when the propeller-heads were working on the new and improved version of C, there was much debate on whether it should be called D or P. Calling it C++ was a majestic stroke of geek humour since ++ is a shorthand programmers use to add one to a value (most processors have a specially optimized way of doing it since it is such a common operation). And of course, C++ was a big influence on the design of Java which in turn was ripped off by a big influence on C#. And so on.

Languages like Java and the .NET ones are the way to go, not because they are write-once, run-anywhere (since they're not) but because they come with a huge, standardized library of functionality. Of course, the problem with Java is that Sun messed up the way they sold it (amongst other things); it remains to see how .NET will fare. But this is definitely the way in which we want to head. As Paul Graham says:

Inefficient software isn't gross. What's gross is a language that makes programmers do needless work. Wasting programmer time is the true inefficiency, not wasting machine time.

At least, that's what I always tell my boss 🙂 But it's true, laziness really is a virtue, at least for computer programmers 🙂

Sometimes I look at the code for the RSS readers written in .NET and get jealous at how easy it is for them to do some, nay, most things. For example, Awasu has a module that downloads and uploads stuff to and from a remote server; it handles HTTP, HTTPS, FTP, authentication, proxies, redirects, compressed responses and currently weighs in at a cool 1113 lines (well, 783 lines of actual code - I comment a lot :-)). In .NET or Java or Python, downloading a file can be done in a few lines of code, at most 😥

I don't feel jealous for too long, though. It's the difference between taking the time to learn and become a master craftsman and make your own furniture and buying something from this year's collection at Ikea. As Paul Graham points out, a lot of modern programming languages act as nannies for developers, prohibiting them from doing many things that are deemed to be "dangerous." This is done because the bulk of computer software is written nowadays by herds of semi-competent developers who have been corralled into cubicle farms, churning out mass-produced software. There is a school of thought that says that language influences the way we think and this definitely seems to hold true in the IT industry; people who program in different languages tend to approach problems differently so given the current trend of languages designed for dumb programmers, the future doesn't look terribly bright... 🙁

But .NET is truly a revolutionary idea, having all programming languages boil down to the same set of underlying instructions, all using the same comprehensive libraries that take the drudge work out of anything you might want to do. If Microsoft play their cards right, programming is going to be a seriously less interesting field to be in over the coming years. Which is as it should be - do we really want our retirement funds and voting machines and all the other infrastructure we are so reliant on now to be run by software that we're not really 100% sure of what it's going to do? Nevertheless, it's going to be sad. Less fun at the very least 🙄

Anyway, if you're a programmer and care about what you do, check out the rest of his articles. And if you're not a programmer, the following are some intriguing analyses into the hacker psyche (note that there's a big difference between a hacker and somebody who just happens to program computers because they get paid for it):

No block quotes, just go read 'em...

2 Responses to this post

I totally agree with that article title that laziness is a virtue, at least for computer programmers. Laziness is the motor of creativity !
What got my attention in this article is the BIAS for .Net. Yes .Net is great the only issue with it, is that .Net is a Windows centric technology. Ok, you may argue that .Net is being ported for Linux, ( http://www.dotgnu.org/ and http://www.monoproject.com/about/index.html) but the reality is that Microsoft is in control of the technology which is not open...
Java in the other hand is not Windows centric, and at least has the community process that allows input from the community to evolve the language. Also, I partially agree when the articles says that modern programming languages act like nannies. One could say the C act like nanny when compared to assembly... modern economics dictated that you shouldn't have to write 100 lines of code when you can write 1 line and achieve the same thing. It is true, some of these languages are targeted to dumb programmers, but that doesn't mean that non-dumb programmers can't have fun, or won't be challenged. For example, if you know the internals of garbage collection in Java you can write code that performs a lot faster then those written by dumb programmers. Just to put in perspective, I started my carrier writing device drivers for DOS, Windows 3.1 and OS/2 in assembly and C languages. I still like to code in assembly, to play with BIOS, etc, but I will never go back to writing pure C code.
Once you really master C++, or any OO language for that matter, pure C code is just plain ugly. :>)

Argument on writing faster programs by optimisation is already seen in history and did not yield any particular advantage except on a short term. I remember times when we use to save byte here or there on TI58/59 or Z80 by optimizing code, reusing blocks and all other wizardry that was available at the time. Yes we wrote ultra fast ultra fine ultra small programs and dreamed on packing re-entrant OSes that would do wanders in 1Kb of ROM. But now, some 25 years later except good fun at that times and some nostalgy, there is nothing else in it - all that "wiz" art is forgotten. Automatic compiler optimizations can do more and better than any human once problem is identified and satisfactory solution is found, computers are getting faster and faster, memory is growing. This is supported by already gained experience. Once kilobytes became megabytes, megahertz became gigahertz many things that we have cared for suddenly become irrelevant. Once we pass tera or peta bytes, move to quantum speeds and move to neural webs of processors (or whatever latest tech craze will be) whatever we may do now will easily become irrelevant. In spite that you may write finely hand crafted compiler you also will be better off by using some YACC. Unless it is visible our art is very little appreciated. Not that after 25 years computers are any better, but yes, it is amazing where we come to...
What I wanted to say - Just do not use weak arguments. There are hardly any more challenges in these times of fashion economy controlled engineering.
Awasu is really interesting - nice piece of work!
Cheers buddy!

Have your say