Wrong ColdFusion Religion

This is a realization that has been thrust upon me over the years. I belong to the wrong ColdFusion religion. My religion is that ColdFusion was designed for clean, understandable applications written in a quick and easy style by people of all levels of programming skills. This is NOT the current religion of Frameworks and OOP.

I was burnt a while back when daring to suggest that a framework could be altered to fit a client. I see that I was right then and I feel I'm still right now. I'll use a framework when it's required and will only use parts when they're required. I'll use OOP when it's required and only parts when they're required. I'm not going to accept the dogma that says that frameworks and OOP are the one, true way to go.

And the new golden child, ORM? Well I'll use it when it looks right for a project and reject it when not. And when (not if) this opinion gets people upset, well...too bad.

Yes, the above is a rant and one that's been sitting in reserve for years. It was true then and is even more true now.

Comments
jim collins's Gravatar From a pragmatic viewpoint, my knowledge of and experience with frameworks and OOP is a "value-add", like my certifications, that puts me in the top tier of candidates for jobs and allows me to command a high salary.
From a developer viewpoint, every program I've seen (that wasn't written by an expert) that didn't use a framework was a brittle, opaque "ball of mud" that was difficult to understand, modify or enhance. Lots of nested cfincludes, copied and pasted repeated code, and unscoped variables. No thanks.
# Posted By jim collins | 5/17/09 5:36 PM
jim collins's Gravatar Oh , I forgot, the data queries , business rules and display code all on the same page making code reuse or automated unit testing impossible. Meh, I say.
# Posted By jim collins | 5/17/09 5:39 PM
Aaron Greenlee's Gravatar I agree. Pick the right tool for the right job. ColdFusion is great because of the language and feature set itself, and it has a fantastic community that has given us frameworks like ColdBox and Lightwire. But, sometimes a simple page with a cfinclude and a cfquery may be all that is required.

Just know when "to" and when "not to".
# Posted By Aaron Greenlee | 5/17/09 6:25 PM
Cliff Pearson's Gravatar I'm with you brother!

I've always believed in using the right tool for the job - not all screwdrivers were created equally! B->

</cliff>
# Posted By Cliff Pearson | 5/17/09 6:27 PM
jim collins's Gravatar Aaron,
The problem comes when that one page grows to 100 and you have to explain refactoring to the client. "Whats this refactoring crap, the site has worked fine until now, except it seems to take longer and longer to do simple changes, stupid nerds don't seem to know what they're doing .."
The best argument for not using OOP or MVC that I've heard is "billing by the hour..."
# Posted By jim collins | 5/17/09 6:38 PM
jim collins's Gravatar Cliff, ironical€€ly your last blog post gives an excellent argument for using OOP:
"This CT takes 4 parameters, like so: <cf_getIPAddress subnetcode=”encr” vlan=”1? compsub=”1? comptype=”5?>. Using these 4 parameters, the CT will return the IP address of the component, along with any component-specific labels (such as a prefix of ‘Virtual’ for certain components). The problem is that I have to put this code snippet into 30 different files, with a total number of 1,116 insertions! That in itself is a lot of work, but when you consider that for each of these I also have to update a DB table (as one of the parameters isn’t currently recorded), insert the CT code, check and update the four parameters, save, upload and test, the task grows exponentially. It’s taking about 2 minutes per insertion, so by my reckoning, it’s going to take about 37 hours to complete what my boss and I both thought was going to be a fairly simple task. I wonder how long it will actually take? I’ll report back when I know."
Dude, WTF? If you ever have to modify that, you're screwed.
# Posted By jim collins | 5/17/09 6:43 PM
TJ Downes's Gravatar Jim, the same comparison could be made of a lot of framework apps I've seen. It's the coder, not the code, that creates these issues. To debate that would be silly.

Frankly, frameworks are a massive performance hit to any application. I don't care what anyone argues, I've experienced it. I've seen an app converted to use a simple DI framework and perform 500% slower. The mindset that CF developers have, and many other developers, that CPU and memory are cheap is not the right mindset. If I have to spend $35k to run the same app I can run for $5k there is an issue, and that extra $30k is NOT saved in development. Frankly, framework-based projects often are many times more expensive to develop than non-framework apps. And in the end, was it really needed? In the 10-12 year life (if that) of that app, how much really changed?

For many of the simple, one-off apps that the majority of CF developers create, frameworks are a waste. Contrary to popular belief, there is a HUGE majority of folks who never have need of a framework. I also believe frameworks make lazy developers.

This being said, I do believe there are many cases for frameworks. I've taken to them for a few of my projects and have seen the benefits. But still, I don't believe that for 70+% of the apps I have built that a framework was a worthwhile investment.
# Posted By TJ Downes | 5/17/09 6:49 PM
Cliff Pearson's Gravatar @jim

Ahh! The delights of supporting an application built on CF 5! B->

Yes, I'm in that unhappy place at the moment! No OOP for me at the moment - Pre-CFC baby!

</cliff>
# Posted By Cliff Pearson | 5/17/09 6:59 PM
jim collins's Gravatar @cliff
Yeah , I recently was offered a job; the first thing the recruiter told me was it was CF 5 with no upgrade forseen. I politely declined and the recruiter said "yeah thats what everyone says, I'm having a hard time filling this position."
So can't say I feel your pain, but that would sux0r.
# Posted By jim collins | 5/17/09 7:04 PM
Mike's Gravatar Amen! Your post is spot on. Over the past few years the biggest selling point of CF has been lost--it's about creating solid apps easily while also supporting Frameworks and OOP.

There's certainly nothing wrong with OOP/Frameworks, but there's nothing wrong with CF 5-like development either. It's a matter of knowing when/where they're needed.

In Macromdia/Adobe's push to sell CF as an enterprise platform, they've lost many of us in government, education, non-profits. CF has been used in these areas because it was easy to pickup by all level of developers. With some training and some time, you could build something useful.

Anyhow, Aaron's comment of knowing when to and when not to is correct.
# Posted By Mike | 5/17/09 8:56 PM
Raymond Camden's Gravatar You sound a bit defensive here, MIke. ;) Most people I know using frameworks are NOT saying there are the solution to everything. In fact, any experienced developers knows that there is never "One Right Way". Shoot, that's probably one of the biggest hallmarks of an experienced developer.
# Posted By Raymond Camden | 5/17/09 9:31 PM
Aaron Greenlee's Gravatar @Jim,

If your site can grow to 100+ pages, you should have planned to use the right tool. If your making three pages, a FW may be overkill. As a general rule, I use CFCs and frameworks for my projects. But, I've strayed from time to time for simple projects.

Thanks for taking the time to respond.
# Posted By Aaron Greenlee | 5/17/09 9:41 PM
zac spitzer's Gravatar salient post :)

i use frameworks and cfcs, but having recently taken over an old school site,
there is defiantly something rather RAD about the old skool approach

I am really really over reloading frameworks every single f^^&^k cfc change

at least some frameworks haved moved away from MVC(XXXXXMMMMLLLLL) CFML is far more powerful than XML! autowiring all the way, the XML oft violates the DRY principle
# Posted By zac spitzer | 5/18/09 12:29 AM
Cliff Pearson's Gravatar @jim

To be honest, if the market wasn't as depressed as it is in the UK and if this contract in Brussels didn't pay so well, I may not have taken it, but as a professional developer, you have to keep putting bread on the table - it doesn't really matter which tools you use, at the end of the day.

I think the consensus is that this isn't a right or wrong discussion.

</cliff>
# Posted By Cliff Pearson | 5/18/09 2:16 AM
Brian Kotek's Gravatar Michael, this seems like a pretty loaded post, since I don't know a single framework author or OO proponent who would disagree with anything you said. No one is saying "use a framework and OOP for everything you do, under all circumstances, or else you're an idiot". So I'm not sure where you're getting this "evil OO and frameworks religion" from, but it's definitely not from any of the people building the frameworks (unless they're telling you this in secret).
# Posted By Brian Kotek | 5/18/09 12:14 PM
Jared Rypka-Hauer's Gravatar Michael, I think you need to chill the rhetoric here. Nobody's forcing anyone to use OOP or frameworks or anything else. Nobody with a brain (or even half a brain) would suggest that frameworks or OOP is the best tool for every job.

Hell, in one of my last gigs as an independent I wrote the app as procedural in Fusebox because Fusebox fit the job well and let me put the app together _fast_. You really don't give any detail about how you were "burned" or the actual details of how "a framework could be altered to fit a client", but if you were suggesting to change core files and put a nonstandard version of a framework into production... well, you were playing with matches, and everyone knows that if you play with matches you get burned.

The whole reason one runs a framework in the first place is standardization, ease of upgrades, a common language across a developer base and a whole bunch of other things that count on the framework being consistent. Changing it (depending on how or at what level you're changing it, anyway) is almost always A Very Bad Idea (tm)). On the other hand, with, for example, Model-Glue, you have the option of overriding framework components at the application level and using ColdSpring to make it work... so you can implement your own versions of core files without actually touching the framework itself. Then again, even doing that isn't (generally) changing the basic nature of the framework so much as tweaking specific details to your own advantage. Case in point, I have a custom extended MG controller that adds logging to makeEventBean(), so you can take a peek at what your controller is finding as it goes about doing what it's supposed to do.

I think the only concepts that anyone would harp on are encapsulation and loose coupling which are key concepts in any, ANY, programming situation... except where they're not.

The _only_ thing that matters is to know what you're doing and why. Not using a framework? Why not? "I'm not using CFCs in this project" is a perfectly fine statement, as long as you have a decent answer for the question "Why not?" In the project I mentioned above, it was because other devs would have to support it AND it had to go together fast, so procedural was the primary choice. Fusebox gave me a way to reuse their existing codebase with very minor changes (and a very flexible end product at that) and a very robust request-processing platform, allowing me to simply focus on the data and the display.
# Posted By Jared Rypka-Hauer | 8/13/09 3:03 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9. Contact Blog Owner
House of Fusion | ColdFusion Jobs @ House of Fusion | Fusion Authority