Friday, January 25, 2008

Simple is efficient

This paradigm applies in many spheres. I've just read a blog rant from Steve Yegge about how he is among the small minority who think that code bloat is a major problem. So I'm not alone! Yes it's true, people actually boast about the number of lines of code they have written. I well remember a Southampton lecturer did that very thing when he was describing his Fortran monster of an optimising fluid-structure code. I really found it difficult to decide what expression to show him as a sneer would have been too impolite. However he must have been used to people falling over with delight when he described his code bloat so my passive face made him leave shortly after. I hadn't cooed over his baby I guess. Actually, maybe he was psychic because I was thinking at the time "if you can't even see the need to optimise your code, then what the heck do you know about optimisation"?

Though all engineers are really amateurs at code churning, the professional programmers are just as lame on this point. I remember being told that programmers used to be paid per line of code written so maybe it's the old survival instinct. Anyway if you went into any programmers forum a few years ago and said you want to use mainly C rather than C++ to avoid code bloat you were treated as a complete idiot. The standard responses were roughly:
a) programmers time is much more costly than that extra RAM or processing power,
b) Do you want to go back to using a Sinclair spectrum or a Citroen 2CV instead of using modern tools,
c) Don't you realise that object orientation, data-hiding, multiple inheritance, blah, blah,... pick your buzzword.. is essential to code readability, security, reuse, sharing, blah, blah, blah.
Of course it's funny that now the same people have brought their same arguments to bear, en masse, to C#. For example, you say; "I don't want my users to have to download 60 megs of crap just to use my software, I'll stick to C++ thank you" and these same guys who had previously hurled abuse at you for daring not to drink the wondrous elixir of C++, now apparently find that C++ is a veritable pile of steaming dung compared to the new religion of C#. Fashions eh!

In the same vein I lament the death of the Atari ST which started instantaneously just like in the films (but not real life). An operating system in ROM what a great idea. Like the QL, it was doomed by the rise of the Amstrad and other clones. Another triumph of mediocrity over elegance! There was even an alternative pre-emptive multitasking operating system called SMS2, based on Sinclair's QDOS, which actually fitted in a 250k pluggable ROM cartridge - I bet it would still give most operating systems a run for their money. And why can't we even now have our operating system in ROM or RAM. I have 1 Gig of fast RAM in my pocket, the size of a postage stamp and it even plugs into the computer, but I still cannot store an operating system on it to overide Windows. Too simple an idea?

Anyway the same paradigm applies to engineering design and this time I'm paying no heed to the fashionistas. Fewer parts mean less maintenance, less chance of a fault and more chance of the thing working in the first place. When applied to the motor car this obviously means the best engine is no engine at all. Well Ok, I've never liked the conventional IC engine: It's like one big collection of kludges and bad ideas wrapped together in a needlessly complex and self-defeating system. Controversial but I'll explain what I mean in a future blog article. The rise of the battery / fuel cell cars is at last coming - 100 years late but it's coming and unbelievably I'm involved in it. More of that later too.

Sphere: Related Content

No comments:

Post a Comment