The Elements of Programming Style
Many years ago, I had the pleasure of working at Murray Hill Bell Labs. My job, of all things, was making violins, but that’s a story for another time. My office was in section D of the 5th floor of building 2, which was also where the UNIX room was. I learned a lot from looking at the code written by the creators of C and UNIX.
It is terrific to watch Brian Kernighan giving this talk about clarity in code. A lot of what he shows as bad examples are grist for the mill of the Daily WTF and such sites. And while I don’t always meet all of the goals of clarity (who does?), I do try to write things so that they can be read.
That’s one of the reasons why I was so pleased when Rick showed me his hill climbing code before he wrote his blog article: it’s beautiful code. It reads like a textbook algorithm. Nice job, Rick.