Thursday, October 13, 2011

Dennis Ritchie, the creator of C, dies at 70..

When I first got in touch with C it was in the early 1980's. I was a sysadmin at a Swedish telco operator (then THE Swedish Telco operator, Televerket, nowadays called Telia) for a system used for software development for a PABX system called A345 in Sweden, better known as Meridian in the rest of the world (co-developed by Televrket and Nortel). The Meridian system was the biggest of the non-custom built PABXes in those days. The language used to program it was called SL-1 (Switching Language 1) and the development system, like editors (vi / ined), compilers etc was running on a Unix system.

This sure was one of the earliest commercial uses for Unix, the Unix variant was version 6 and was not a BSD or anything like that, this was way before BSD really. Rather, the system was built by Interactive Systems which was the first commercial Unix vendor. This was version Interactive 2.5, based on Unix version 6, mind you. sh and csh only, no bash. Lot's of hardcoded stuff in the shell etc. The hardware it was runniing on was a PDP-11/70.

I knew a bunch of programmiing languages already, like Pascal, Basic, APL (yes! APL), Fortran etc. Also, I had done my fair share of microcompter assembly (mostly on 6502 and some 6800 CPUs). As the system we were sysadmining was so Unix focused, everyone who got in touch with it had to know some C, so eventually I was sent on a C-class (not a C++-class that is ;-). This changed my life, to a large extent.

Having access to a reasonably high-level language like C, that was still so close to assuembly and hardware (did I tell you I was a hardware geek also?), was just what I wanted. Close to the hardware, but high-level enough so you could write reasonably sized systems with it without spending too much time on individual bits and bytes, except when you wanted / needed to.

Of the things I have learnt over the years in the IT-industry, like Windows, Linux, SQL, database, optimization, multi-threading, you name it, none of them has been even close to being as useful as those C-classes I took nearly 30 years ago.

Dennis Ritchie, the creator of C, really got C completely right. And thing is, C was very close to being perfect even at the first try. Look at "The C programming Language" book, this has to be one of the most concise book on programming I know of. And I still use this book. It's factual, at times funny and always complete. And this in a very small package, really amazing compared to the 650 page books on C# or something of today. They say C is so complex, so why does it take just over 100 pages to explain it? And 600 something to get started with a language that is supposedly "easier to learn"?

Want to know how to write solid code from the ground up? Learn C, even if you will eventually develop in some other laguage. Want to learn hos coomputers work? Learn C. Want to understand how Windows works? Learn C (this is how I learnt Windows some 20 years ago, using Windows 3.1 and 3.11. I was writing Windows apps in C (and this is how I still, to this day, develop Windows apps), and suddenly I knew how Windows worked, without even trying).

Too bad that Dennis Ritchie is dead, but the legacy of the world greatest programming language, C, lives on. C has been used to develop applications on all kinds of levels, from end-user applications to databases and infrastructure to operationg systems. If C++ better that C? Probably so, but some features of C are gone in C++ and some things that C++ adds aren't so great. What about C# then? Same there. What about Java? Nope, it's a good language and a good environment, but I still prefer C, which is not to say that Java doesn't have it's merits. And then we come to things like Tcl/Tk, Perl, PHP, Ruby etc? Useful tools alright, but not really proper programming langauges in my mind, and not proviing the insights you get by understanding C.

Over the years, when I have been with a customer or used some program and something broke, knowing C meant I could much faster diagnose what was wrong and how to fix it. Pascal / Fortran / APL and all those languages never did that for me. C required an understanding of the environment that the code was to execute in, but once you had that understanding, things got A LOT easier, and you suddenly knew things that you didn't before, which weren't directly related to the task at hand, but you knew it.

Rest in peace Dennis, and thank you for bringing C and Unix to the world. I know that my life would have been very different without C and Unix.

/Karlsson
Born to code in C. Using vi (as emacs didn't fit in the memory of that PDP-11/70).