Over on the CFAussie list, Jason Sheedy asked this question. In his post he said:
I find myself asking, ‘why OO in a web environment’ and ‘how often do you
really need to re-use code blocks’?
I started writing a reply with my take on this issue but it started to turn into a bit of an essay so I decided to post it here instead.
This is actually something we discussed at the last CFUGWA meeting. I also find myself asking “why OO in a web environment” but for different reasons. I do find myself reusing code blocks a lot. But code reuse is possible with Fusebox 3 and 4 too, and there are other factors to weigh in too.
For reference, here’s a rundown of the environment I’m talking about: small scale web development shop – shopping carts, simple custom-requirements content management, membership systems, subscription systems, online payments. A lot of static web sites, too, or static web sites with a very small dynamic portion. Anything that is generic we develop in PHP – mostly because the hosting is cheap and plentiful. Anything that has slightly offbeat requirements, needs any significant amount of custom code written, or has to interact with existing materials like Excel files or Access databases or LDAP directories we develop in CF. Up until recently, I was the only ColdFusion-specific developer. Our team has lots of people with PHP experience, and a couple with ASP experience too. As we’re operating in the lower end of the market – small to medium business, and generally not large corporate or government systems, the people we hire are usually either straight our of TAFE or university, or with a year or two of commercial experience. Lately with the industry picking up, more and more of our new hires are straight out of school.
Please note that I’m not trying to generalise – all my comments are based on the specific requirements of the environment listed above, because that is what I have experience with.
I have a library of circuits written in Fusebox 3 that are constantly re-used – login systems, membership systems, subscription management, product management etc. They have been thoroughly tested in production systems for over three years now, and they work really well. Eventually, some of them will end up being converted to Fusebox 4 as new code is written.
In the past – three or four times over the last three years, I would say – we have had a CF project with an impending deadline – i.e., one that I couldn’t hope to finish in time on my own. In each case, a developer with some PHP or ASP experience has taken over, and based on my common Fusebox circuits, has delivered the project on time and to our code quality standards.
This is possible because:
- ColdFusion code is simple and straightforward to pick up
- Well-written Fusebox 3 code is simple and logical (and Fusebox 4 is almost as simple)
So, would Mach-ii be good for our team?
Q: Would Mach-ii make our applications run faster?
A: Not any faster than an extra gig of RAM in the server would.
Q: Would Mach-ii speed our development time?
A: Initally, no. Over time, for those of us who are ColdFusion developers, possibly.
Q: Would Mach-ii make it easier to get new developers up to speed on existing projects?
A: Big time NO. In fact, I think it would make it significantly more difficult.
It was mentioned by Andy at the CFUGWA meeting that if you had Java programmers, it would possibly be easier for them to pick up Mach-ii. That might be true… however as we haven’t ever had a Java programmer in our shop I can’t comment on that one. Its been hard enough to find the right kind of people when we need them – if we can find someone with PHP skills who understands web standards and has a good attitude we consider ourselves lucky. I wouldn’t want to add to our requirements “and has an understanding of OO coding principles” as well, or I fear we’d never find anyone.
So on the whole, Fusebox 3 has been very good to us and I have no doubt that Fusebox 4 will prove to be even better as time goes on. I’m also sure that Mach-ii has a place in larger shops or those that already have OO programmers or thsoe who have the budget to hire people with years of experience. But for our purposes, I think the winner is clear.
I’m still looking forward to Sean Corfield’s presentation at MXDU. Who knows, maybe I’ll walk out a convert!