Thursday, October 13, 2011

CODE

Code is a creative four letter word.

I have spent 3/4 of my life writing code.  By that I mean that I have written computer programs in a programming language to direct computers to... well... do something.  Hopefully something relevant or interesting... at least to me.  People who don't program will often look at code and wonder what it all means - but to people who know how, the lines and blocks of code can dance, even if you don't know the specific language they're written in.

When I first began this adventure, I learned a language called BASIC.  Now ridiculed for some of its overly simplistic and lack of easy-to-follow structure, it was easy for me to begin to explore this magical world.  As I grew up, there would be other languages I would learn.  Pascal... Scheme... Java... Each had their own patterns and ways of thinking.  One cannot really learn just the language... one must also learn how to think in the language.  One must learn how the code should look.  For most languages, there is an elegance to the code that is written for it, by which you can judge how "elegant" the program is.  People have asked me how I write programs... and that is difficult for me to explain.  On one level, it involves understanding the problem and finding the algorithms to solve that problem.  On another level, however, it involves finding the best way to express those algorithms in the language best suited to them.  This is why so many programmers see coding as both an art and a skill.  The skill is not so difficult to teach - the art is.

Word comes to us today of the death of a skilled artisan and craftsman when it comes to coding.  Dennis Ritchie is a name that most people will never have heard of.  But if you use a Mac or Linux-based or Windows-based computer, or a web server or browser, or an iPhone or Android, or have any contact at all with nearly any modern computing device - you have been touched by the work of this man.

In the 1970's he worked at Bell Labs developing the UNIX operating system - which currently is the foundation of Linux, the core of Max OSX, and present in quite a few components in Windows.  As part of that, he designed a programming language called C which was used to help write UNIX.  One of the significant, and elegant, components of C was that it was not tied to a specific operating system, or even to a specific piece of hardware, but that it represented very low-level concepts about computer hardware without hiding those concepts.  This made it easy to write programs that would work on more than one type of computer, and thus make it easier to port UNIX between different types of computers.  This was an absolutely revolutionary concept at the time - languages were tied to operating systems, and operating systems were tied to the type of hardware they were built for.  Many of the language, syntax, and styling constructs of C have been brought into modern languages such as JavaScript, but C itself has not been abandoned - most of the web servers that run on the Internet today were written in C.

On my bookshelf is a copy of the book The C Programming Language, Second Edition.  In the industry, this is universally known as K&R2e - referring to Dennis Ritchie and his partner in developing C, Brian Kernighan.  In the book, the two described the language and common idioms of the C language in a casual, almost conversational, yet still educational way.  For many years, the First Edition of the book was the de-facto specification of the language, while the Second Edition reflected changes made by a standards board with K&R's stamp of approval.  The Internet is full today of people talking about Ritchie and how they met him and experienced his warmth and brilliance.

I have no such memories - I never met the man in person.  But I have this book that did more than just teach me about programming... it helped teach me the art and the science of how to code.