Showing posts with label coldfusion. Show all posts
Showing posts with label coldfusion. Show all posts

Monday, May 25, 2009

ColdFusion and deprecated code

Lets take a step back in time to 1999. At that point I had been doing a mix of Foxpro for DOS, Perl, and an obscure language called WebML (don't bother looking it up, it doesn't seem to exist anymore). I admit I liked Foxpro but recognized it was a coder's dead end. Perl gave me regular expressions which I liked but I was uncomfortable with everything else. WebML was okay but it was clear that it was too obscure. Around that time I even talked to some people doing something weird with Python and Zope in Fredericksburg, but that sounded even more obscure.

At my job we had someone throw together a ColdFusion 4.51 application. They needed some help. I took a look and quickly figured out the issues, made corrections, and realized this language was really simple. One thing I noticed while pouring over the built-in documentation of the CF IDE (this was back when I used IDEs) was that there was a list of deprecated functions. You were supposed to stop using parameterExists and use isDefined instead. I shrugged, followed the specification, and moved on.

Years went by. I did Java and ColdFusion. Both were annoying because of spaghetti code. Java was also annoying because of boilerplate and the static typing, ColdFusion was annoying because of the tags, the weird ecmascript implementation, and the insistence of developers on using the deprecated functions.

The most obvious example was the parameterExists vs isDefined issue. The former, paramExists accepts a variable, so you couldn't build dynamic code. Specifically you did something like parameterExists(my_variable) instead of like isDefined("my_variable"). This meant more cut-and-paste coding. Also, because it was a deprecated function, the owners of ColdFusion didn't care about the performance of the code. So instead of looping through an array of a hundred or so variables who existence you wanted to check using isDefined, people would still @#$%ing type out parameterExists a hundred times. Or more commonly, cut-and-paste from one code template to another, across applications. A good number of the parameterExists at the top of a CF page often have nothing to do with the purpose of the page and people would wonder why things ran so slow.

Sadly, this sort of behavior still happens today in the CF community. Worse yet, because in my experience the CF community tenure is more important than anything else, the worst offenders are often the people who have been using the tool the longest.

So lets go through a quick summary of my issues with ColdFusion and deprecation:
  1. Deprecated language elements, even if deprecated over 5 releases, are... well... deprecated.
  2. Deprecated language elements are likely the last to be examined in a release for performance or security reasons.
  3. Deprecated language elements can go away.
  4. The worst offenders of using deprecated language elements tends to be those who have used the language the longest.

Thursday, January 10, 2008

Reason #4293 why I'm happy to be out of ColdFusion

At my job the majority of developers do ColdFusion (CF). And most of them code in it as if it were still 1997 back in version 3, but they do it on modern CF 8 servers. That means using lots of deprecated bits or making it one giant procedural mess with the only complex data object being SQL query result sets (no arrays, structures, xml, etc). Unit testing is ignored, as is use of modern CF frameworks especially the useful ORMs that now exist. At best they use some of the reporting tools and thats all you get out of them.

Well, at another job location a pair of smart CF developers wrote an application using all the modern bits of CF8. That means object-oriented code that had fancy things like duck typing.

The software was brought here, and you know what? It was assigned to a 'senior developer' for slight modifications to accommodate some differences in business logic. And that 'senior developer' promptly yanked the code out of the objects and rendered it into lard... I mean procedural code. And the racehorse application turned into a turd.

Now in the Python world this would not happen. If we needed to change something, we inherit the modules needed from other people's work. I did that with Trac's admin console, mildly rewriting three methods to move them out of the console based atmosphere.

If you ever did do something like obfuscate and slowdown existing code in the Python world, you would get your knickers beaten. In the ColdFusion world, you are considered senior because of tenure.

Sigh.