Coding practices (or lack thereof)

I have found many different coding styles over the years, since I have gotten to see a lot of code written by a lot of different people in a lot of different stages of their own styles.  I myself have changed my style of coding over the years.  I always want to work with ‘best practices’ but sometimes that gets to be more of a hassle than programming it in the first place.

Back in the day, coding was about taking as many shortcuts as possible, keeping the footprint small but still functional because there was a limited amount of space where we could hold code and data.  That started to cause a few issues round about the year 2000.  When the web started to gain momentum, and we had our 14.4 kbps modems (my first modem was actually 9600bps, but that’s neither here nor there), it was about download speed.  We couldn’t have lots of stringy code and images to slow our surf speed down.  We wanted information, and we wanted it faster.  Today, most people are running off broadband connections at lightning fast speeds, so do we have to care that our javascript file is a measly 125 kb?  Well, not really.  Just about everyone is feeding as much ‘rich content’ to us as possible to feed our society inflicted ADHD.  What we do need to worry about today is programmer efficiency. 

Chances are, when you write a piece of code for the web, unless that company goes under, someone (possibly you) is going to have to look at that code and have to work with it.  Whether it’s an upgrade to the site, or a change in functionality, it will have to be done.    Now there can be issues with code running slowly that can be optimized, but for the most part, there’s some sort of happy medium we can all find to make the code quick and easy to update. 

Depending on who you speak to, you’ll get a different approach to keeping the code clean.  Most people will say ‘keep the design seperate from the functionality’ which I tend to agree with.  Of course this approach does not delve into what ‘functionality’ is, and how to deal with the fact that most of the functionality is highly technical itself.  Within the functionality, I have learned to like keeping my logic seperate from my data access or rudimentary functions.  This is nicely possible with ColdFusion’s use of CFCs and functions that I didn’t have available when I first started working with ColdFusion.  I can set up a whole slew of related functions and call them whenever I need so that I can keep my design layer, logic layer and nitty gritty stuff showing together, but put into nifty little packages that make changes simple and efficient.  Of course since I’m still working it all out, at the moment, it’s not so easy, but as I learn what I can do with the latest technology, I make greater improvements in my personal best practices. 

Spaghetti is for dinner, not for code.