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.
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.