Oct 19 2012

Simple, concise programs

c bsd programming

A professional programmer is constantly searching for sharper tools for the toolbox, and continually discards and replaces algorithms, libraries, and paradigms as better ones are found. A natural pattern emerges: these recipes for implementing ideas become cleaner and more succinct over time, asymptotically approaching an ideal. Much as a crystal forms as atoms rearrange themselves seeking the lowest energy state, the programmer’s toolbox crystallizes around the ideas that they are meant to implement.

One source of well-written, crystalized code is BSD. Most users don’t directly interact with BSD, but its permissive license and straightforward engineering have seen its code spread pervasively. Since it has a more unified development model than most Linux distributions, its code is more consistent across the whole OS – both kernel and userspace. In addition, it tends to take a no-frills approach to software (compared to GNU, for example). This may be more annoying to users, but a great boon to those reading the code.

Spend some time poking around the tree: one item I have used often is NetBSD’s hash library, which holds up well despite being 18 years old (!). Another program I enjoy is rain (of which I have an updated version on github). Really cool stuff, and you’ll come away a better programmer and a better engineer.



show/hide comment box