We are often called upon to fix or upgrade applications for our clients. In that capacity we have had the fortunate (or often unfortunate) task of reviewing code that has been written by others. Of course this gives us CF Webtools developers things to talk about around the water cooler - "Hey... did you see that loop? What a piece of work eh?" (followed by raucous laughter). Hopefully we are not referring to our own code at the time. Anyway, these applications are often written by bright individuals with little or no experience in Coldfusion. Coldfusion is accessible in a way that makes it possible for someone to churn out a site or application if they just start at the beginning and keep "slogging away" till things seem to work. Of course, after the applications is under load or the data set grows or the technology changes you have to call in the big guns (that's where we come in). Still, the sloggers produce a great deal of the Coldfusion code in the world (perhaps contributing to Coldfusion's unwarranted reputation as being too "light weight" for serious applications). Here are some of the sloggers we've run into.
Novice slogger code reminds me of code I wrote when first starting out as a Coldfusion programmer. I read a book called "Mastering Coldfusion 4" by Arman Danesh and took off like a rocket adding switches, pound signs, and if elses. Arman had given me the knowledge but I lacked the wisdom to use it effectively. My code was thousands of lines long and I never neglected to do in 150 lines of code what could be accomplished in 2 or 3 lines (read it carefully - you will get it). You can identify a novice programmer by looking for code like this.
Now many folks come to Coldfusion from the world of HTML and find a home programming in Coldfusion. Some, maybe most of these folks are really programmers at heart and have only worked with HTML to "get things done". But there are a few folks out there that are really designers who dabble in Coldfusion. Their pages are beautiful but when they write code it defies description. Usually it is a confusing conglomerate of HTML tags and Coldfusion tags with little rhyme or reason. An HTML designers Coldfusion code looks like this:
This is a programmer who has never made the break between what they learned in school or in a seminar and the real world. This not only makes them incapable of growing it usually makes them arrogant and truculent about the way things should be done. Academic programmer's code looks like this:
This is a programmer who likes PHP or .Net or some other language. They have been forced to work in this inferior language against their will in order to meet some requirement created by a person with the mental capacity of a chrysmeeth... a chrysamtheme... a big white flower. Generally they rarely miss an opportunity to point out how much better A or B would be in their (obviously superior) language. They have never taken the trouble to learn where Coldfusion might benefit the code. Consequently their code looks like PHP or .NET code that has been shoehorned into Coldfusion.
In fact, a well known ecommerce package (which shall remain nameless) hired a Java programmer to "port" their CF 4 code to CFMX. Since CFMX is a Java platform, that could have worked out pretty well, but what they got was a monstrosity of servlets, classes and impossible logic. In fact, this programmer took all the Coldfusion Query objects and read them into Java arrays so he could use javaesque loop syntax for display, adding dozens of lines of code to every place where queries where used. The result was un-scalable, un-maintainable, un-upgradable and unbelievable.
Still, if it wasn't for the folks above I suspect that fewer people would need CF Webtools or its services. So for all you CF sloggers out there, getting the job done by hook or by crook, both arrogant and lovable (and you know who you are). Let me say thanks! We salute you from the heart of our bo... uh... from the bottom of our heart.