Is Code For Computers or for People?

haseman picture haseman · Feb 7, 2009 · Viewed 8.3k times · Source

Ultimately, code compiles down (eventually) into instructions for a CPU. Code, however, (in my humble opinion) is for human beings to read, update, and interact with. This leads me to the following observation:

Code that is unreadable by other engineers, even if it's functional, is bad code.

With that in mind, what can this programmer do to make code more easily read by humans?

  • Naming Conventions? (Joel has a fair amount to say on that one)

  • Code Structure/Layout? (please, for the love of god, don't get into the { placement debate)

  • Phrasing? (Is it possible to write code that looks more like the English language)

Are there good articles out there beyond Joel's.

Answer

Charlie Martin picture Charlie Martin · Feb 7, 2009

Yes.

If the computer doesn't run it, it's broken. If people can't read it, it will be broken. Soon.