Most visitors to a web page will only see how it is displayed in their browser of choice. They don’t know (or care) how the code that generates that page appears. So why should we as developers care? Because we’ve been told it’s the right thing to do? Well, okay, I guess. If I’m going to spend the extra time required to write clean code, though; I’d like to know a good reason why. (In this post, I refer to clean code and optimized code interchangeably.)
Maybe I should start by asking what constitutes optimized code? I usually think of it as code that is executed quickly. It should use the least number of lines necessary to accomplish the task and be relatively easy to read and maintain. In practical terms optimizing your code usually involves removing any unnecessary fluff and organizing what’s left into an easily understandable format.
Read the rest of this entry »