Blog Indiana 2008

Code as Art

I have always believed that code is a form of art. It should not only serve the purpose for which it was written, but it should also be pleasing to the eye when read.

Jeff Atwood at Coding Horror has posted part of an interview with Wayne Ratliff, the author of dBase. It sums up how I feel about code.

Mr. Ratliff says:

“Balance takes many forms. The code should be crisp and concise. You should be able to explain any module in one sentence, and things should be in alphabetical order, if possible. Just from a visual view of indentation, it shouldn’t go off the edge of the paper at any point. It shouldn’t have one “if” that’s huge and an “else” that’s small. Everything should be balanced everywhere. Balance is the key word.”

I take a lot of flak from my coworkers about insisting that methods and properties are alphabetized. I tend to scroll through code via mouse wheel, so finding a particular function is much easier when all are sorted. It takes a few seconds to do, but enhances the readability of the code greatly.

I’m glad to see that Mr. Ratliff felt this way in 1989.

Posted on April 4, 2006 in Software Development.    

One Comment

  1. Dan said:

    Preach it, brother!

(Comments are moderated.)