I don't hate Mach II

I was doing a remote presentation last night on "Object Orienter Programming for ColdFusion Developers" and it eventually moved over to the topic of optimizing ColdFusion Components. While I was showing what I do for speed, I relayed a story about a client of mine who is using Mach II. I was brought in to speed up the clients site which was timing out on a regular basis.

After a review, I found some places that could be optimized and one major place was the Mach II code. I rebuilt most of it and the time savings was immense. Of course, in order to make it faster I had to cheat and break many of the accepted 'rules' of OOP and CFCs. Not something that I suggest anyone doing without a full understanding of the how and why of it (which I'll talk about another time).

After telling the story and showing what I did, someone assumed that I did not like Mach II and asked what Framework I used. I quickly corrected his conclusion and told him not only do I have nothing against Mach II, but it's a really well thought out and solid framework. I don't use it because I don't use any of the public frameworks. I'm obsessed with optimizing my code for speed and performance and really optimal code doesn't go hand in hand with frameworks. On the other hand, I stressed that using a framework is a MUST in almost all situations and that people should not go my route unless they really know what they're doing and have very strict control over who has access to their code.

Bottom line is that unless your a paranoid, obsessive, hermit programmer, use a framework!

Related Blog Entries

Comments
Michael Sharman's Gravatar Hi Michael,

Will you be able to share some of the changes you made on the Mach-II list or directly with Peter or Matt?

I'm sure everyone involved in working with any framework would appreciate performance gains as (like you mentioned) what you gain in using a framework you might lose a little in optimisation.

I think Matt and Peter might be interested in what you found as well :)

Just a question though, what version of Mach-II was it?
# Posted By Michael Sharman | 1/31/07 4:20 PM
Michael Dinowitz's Gravatar Not only will I detail what I did and why, I'll even post the recording of the meeting.
# Posted By Michael Dinowitz | 1/31/07 4:27 PM
Dave Ross's Gravatar Mach-II is plenty well optimized. It's user code that's not. If your application is failing because Mach-II isn't fast enough, you are trying to place too much load on a single instance of CF.

Remember, 20 hours of developer optimization time is another server and cf license.
# Posted By Dave Ross | 1/31/07 4:33 PM
Michael Dinowitz's Gravatar The client has a very high end machine but even with 4 or 5 users it was dragging. This does point directly to the code written by the original developer, but given the time constraints it was easier to do a global optimization of the CFCs, specifically mach II.

I'm writing up a detailed report of what I did and why. I'll have it posted in 10 minutes or so.
# Posted By Michael Dinowitz | 1/31/07 4:42 PM
Jeff E's Gravatar I was very gratified to read your comments about the use of frameworks, even though you seem to say at once they are both necessary and unnecessary. I wish you would write more about this, because I have to admit: I just don't get frameworks.

They sure make things neat and clean, but to me, they just seem to be about housekeeping, with no benefit to the user at all. And as you noted yourself, unless the app is optimized anyway, they can add load and time, not subtract it! The beauty of CFML is its simplicity. With the judicious use of cfinclude, cfmodule, UDFs, CFCs, and even appropriate commenting, I have all the tools I need to organize my code any way I want. If I choose to separate queries from calculations and view, I can have separate files labeled qryFoo and calcFoo and dspFoo - without using Fusebox, Model-Glue, or MachII. Isn't that my own kind of framework? If, after all that, what I have done is not inherently obvious to another coder, I can write a nice little white paper about it and put in a code comment: dear moron, go read about this flow in foo.txt.

Sooo........What benefit do I then get from having to use another syntax and a lot of code, just so I can pound myself on the back for using OO language, or picking up my socks when nobody is looking? Whenever I think about using a framework, I envison myself frantically writing an app quick and dirty anyway (relative to frameworks) to get it done on time and make my customer happy (real world)....and then going back in later to follow the rules of whatever the framework is.

I have only two rules: 1.) right tool for the job. 2.) KISS
# Posted By Jeff E | 3/2/07 11:24 AM
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