I hear a lot of OOP fans say that OOP makes large applications "easier to maintain", and the question always comes to mind "Easier for whom?". If I ask "Who will be maintaining my application?", the answer is "ColdFusion developers", and if I ask "Which programming paradigm are ColdFusion developers generally more comfortable with?", I would have to say the answer is "Procedural". Here in the Orange County/Los Angeles area, it's hard enough to find a decent CF developer without limiting my search to the small amount of people that claim to be OO programmers (and some of those aren't even really OO programmers, they just need a job and will say anything). Not to mention that the CF Developers that really do know OOP are often more expensive than their procedural counterparts.

I am not an OOP guru, so my opinion may not be firmly planted in reality, but I don't think the size of the application really matters when it comes to deciding weather to develop it in pure OO code or to develop it using procedural code and maybe sprinkling in some OO concepts where it makes sense.

I have developed some pretty massive systems, but I don't see how using a pure OO design would have made those applications any easier to maintain. If anything, I think it would have been even more complicated then it already was. It definitely would have slowed down my development (which is not an option for some high pressure, deadline driven, work environments).

I think the most important part of making an application maintainable is making sure that, not just you, but anyone who is proficient with your chosen language will be able to follow the code and understand how it is organized (without having to spend a week or two with Hal Helms to wrap their head around OOP). If, one day, CF developers are all generally more comfortable with using the OO paradigm, and the WACKs are all written so that new CF developers learned how to do OO right from the get go, then I would definitely be on board the OO bandwagon with everyone else, but I just don't see that happening as it would defeat one of the main benefits to programming in ColdFusion: being easy to learn.

I'm not against OOP. If I were developing video games or something in Java, then OOP is definitely how I would go, because OOP is the norm for Java developers. Also, I would definitely be open to spending some time fine tuning OOP concepts in my mind by applying them in some ColdFusion sample applications, just because I am already familiar with CF and it would allow me to concentrate my learning efforts on the OOP concepts rather than learning a new language.

However, while I think OOP is good in theory, and there are a lot of ways I use it's basic concepts to improve the way I write my procedural code, I just don't think I'll personally be using a pure OOP approach in real CF applications anytime soon.

I don't think either paradigm is fundamentally better than the other. I just think they are two ways of doing the same thing. In the long run, how you choose to organize your code is up to you, and I believe the general consensus, among OO and procedural programmers alike, is that it is important to keep your code neat, organized, consitant, and wherever possible, you should try to identify parts of your code where you can write generic modules/custom tags/functions/components/objects/etc so that when you need to change some bit of logic, you only need to do it in one spot.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Brandon Hansen's Gravatar I think that you are right about the goal of OOP just being maintainability. Peter Bell, who I think of as a halfway decent CF developer (just kidding, he's darn good), states that, contrary to popular belief, OOP does not allow much code reuse across multiple applications.

HOWEVER, OOP does allow code reuse among the same application, and that is something that many procedural programmers lose. I have seen hundreds of apps that have thousands of .cfm pages, each with thousands of lines of code, each doing almost the exact same thing. You wouldn't even need OOP, just a few functions, includes, whatever...

Using OOP principles you end up with a consistent API, consistent UI (not guaranteed, but it does help), and maintainabilty.

You stated that it is difficult to find a CF programmer that programs OOP well. The problem that I see is that there are very few CF programmers who know how to program. Period. I sometimes find that since CF has such a small learning curve, people jump into it, call themselves programmers, and write all kinds of terrible apps that give ColdFusion a bad name.

So maybe we don't need to write OOP style code, but I would at least recommend that we know what it is, know the advantages of it (if any), and create goals for ourselves of writing solid code.

Ben Nadel is a great example of a great CF programmer- he knows that he doesn't know everything, so it is his objective to be constantly learning and bettering his apps.

So should OOP be the goal, or should solid, maintainable, commented code be what we are after?
# Posted By Brandon Hansen | 11/3/08 7:33 PM
Scott Bennett's Gravatar @Brandon,

"The problem that I see is that there are very few CF programmers who know how to program"

This is very true, I have hired developers that were "Senior Developers" at other companies for years, and then had to teach them how to not write terrible code anymore, but usually that does not involve teaching them concepts that are foreign to them, just stopping them from writing sloppy code because they are lazy, and forcing them to follow a few rules that ensure things stay organized.

If I had to take those same people and try to explain what Inheritance, Abstraction, Encapsulation, and Polymorphism mean it would be much more difficult.

Solid, maintainable, well documented code is definitely the goal.
# Posted By Scott Bennett | 11/3/08 7:52 PM
Ross's Gravatar Yeah I would agree with you Scott on this.

I've been in the opposite situation where I was the new CF developer telling the "Senoir(Old) Developer" about doing things "well" instead of in a sloppy fashion. Lets just say my views to do things "well" were frowned upon and the thought of OO scared him silly... so I moved on. I'm not here to fix the world just to code to the best of ability.

Even though I'm an advocate of OO I sometimes wonder about peoples use or I should say overuse of the principles in CF. Even though CF has Objects/components it is no Java or C#. I would really like to see the CF OO language features get a power hit so they are more hardy. CF leaves a lot of weight on the developer to make sure they extend, implement, or override functions/properties correctly. In the end this allows for mistakes to be made in the OO structure. So fingers crossed for the CF9 release being focused on the language like CF6 was.
# Posted By Ross | 11/4/08 12:46 AM
Scott Bennett's Gravatar @Ross,

The number of years someone has been a developer does not indicate the quality of that work experience. There are a lot of people that just move from one maintenance job to another who maybe get good at "MacGyver-ing" existing applications to meet the ever changing needs of their employers, but never actually build an entire application from the ground up. I don't think that means they aren't capable of doing it, but it would be a bit of an eye opening experience for them. It's a lot harder to learn how the differences between different design patterns, frameworks, and programming paradigms, when you are never doing any new development.

I was lucky enough that my first few ColdFusion jobs were positions where I have been the "web-architect", but I have also had the "web-handy-man" jobs and can see how I could have easily fallen into the other category if things had been different.

However, the main point of this post really, is that I don't a lot of the "web-architects" that are over implementing OO in their apps just because they think it will be more maintainable (for them) are really truly thinking about who else might be maintaining this application in the future. Chances are pretty high that a "web-handy-man" is going to come along and jerry-rig your work, and you don't just need to make it as easy as possible for him to do that, you need to make it as easy as possible for the owner of the application to find a web-handy-man that can work on the application. And let's face it, most of the "web-handy-men" out there are more comfortable with procedural code.
# Posted By Scott Bennett | 11/4/08 4:05 PM
Sebastiaan's Gravatar Hi Scott, I couldn't agree with you more. It is very difficult to programme true OO in CF and the elarning curve is quite big. Procedural programming using a couple of CF-frameworks (Fusebox, Mach-ii, etc) works like a charm though. And it assures code-maintainability (is that a word???). So even though OO is really nice and it gives you maximum control, I tend to lean towards programmers saying it is a bit overkill in the most situations.
# Posted By Sebastiaan | 11/17/08 6:15 AM
Jon's Gravatar I think you are right on. What happen is you argue not to try to follow the OOP model inmediatly you could be called
spaguetti code programmer. It is almost like a sin.

Like there is no middle ground or bad OOP. Also recruiter ask for OOP and if you don't
mention it you are in the second.

Great Blog.
# Posted By Jon | 1/31/09 5:34 PM
Jon's Gravatar Sorry I typed too fast. I meant "if you argue"
# Posted By Jon | 1/31/09 5:35 PM
Michael Steele's Gravatar Scott,

I've been a web architect for several years. I think there needs to be a clear distinction between OO design and OO programming. In OOD, you are designing with concepts that make it easier to change parts of the application without dependency on other parts. OOP is implementing an OO design in all (or nearly all) objects of some type. As a programmer, to make the leap from OOD to OOP requires that you know how to create applications using objects. However, just as your code should be programmed to an interface and not an implementation, your design should not be (or at least attempt to not be) dependent on the language in which it will be implemented. Granted, each language has its own nuances, big and small, which make certain design implementations easier, but the design shouldn't require it.

As for OOP and maintenance, if you define maintenance as the daily routine of making sure code runs, then OOP doesn't make anything easier, and can, make things more complex as the programmer needs to conceptualize decoupled objects and understand complex object interactions. However, from an architectural standpoint, when the application needs to change because of the ever moving targets of the business shift, then OO design (not necessarily OO code) makes it easier to code. The concepts behind good OO design can, in large parts be applied to procedural programming. A lot of CF web apps end up nothing more than procedural code wrapped in components and some data beans. So you've created objects but the overal design is still procedural.

It all boils down to experience. All the times we looked at code and said, "next time I should it this way". After you've said that to yourself often enough, you might find that OOD isn't so bad after all.
# Posted By Michael Steele | 3/16/09 3:34 PM
Scott Bennett's Gravatar @Michael,

If you re-read the post and pay particular attention to the last few paragraphs, you'll see that I am not saying that OOP is bad, I think it can be very good in the right context. Also, I want to clarify that I don't think the ColdFusion language is the reason that I personally wouldn't implement a purely object oriented application. My primary point can be seen in the first paragraph. Right now, most CF developers are more comfortable with a procedural application than with an OO application.

So if I am building a large application, and I want to make sure that it will keep on running I should take into consideration the currenty climate of the cf developer community to ensure I will be able to also maintain a staff of developers. If I implement an OOP application in today's market, I would have a more difficult time finding developers with the OOP experience I require, and will probably also have to pay higher salaries for the developers I do find.

Even if I should decide that I really like OOP and I want to grow the CF OOP community by hiring promising procedural CF developers that want to learn OOP and teaching them. Then I am adding all that learning curve and I loose my rapid development cycle, one of the primary benefits to developing in CF in the first place.

I personally feel that a good staff of procedural CF developers working on a well implemented procedural CF application would be just as effective as a good staff of OO CF developers working on a well implemented OO CF application. But in today's market, I personally can't justify the extra trouble/expense of trying to find good OO CF developers. If the tables were turned, and most CF developers were more comfortable with OO programs, then I would implement all my applications in that paradigm.

Regardless, of the paradigm I use, it will probably turn into spaghetti code once I (the original architect) leave the company, or move on to the next project, if I don't leave someone there that will enforce the coding standards that I implemented.

So, in closing, this was not an article about "My paradigm is better than yours". It is simply saying that before I decide to implement any particular programming paradigm, or even a particular framework, I need to think about how that choice will impact my time line, my budget, and my ability to staff a development team.
# Posted By Scott Bennett | 3/16/09 5:57 PM
https://www.bababorses.de/Louis-Vuitton-Damier-Ebene-Canvas-Clapton-PM-Bag-N44243-Magnolia-2361-it.html https://www.bababorses.de/Louis-Vuitton-LV-Trainer-Men-s-Sneakers-Top-Quality-15-5322-it.html https://www.bababorses.de/Celine-Small-Cabas-Bag-In-Black-Leather-it-2087 https://www.bababorses.de/Louis-Vuitton-Heel-10cm-Call-Back-Sandals-Nude-6162-it.html https://www.bababorses.de/LOUIS-VUITTON-BREA-MM-Monogram-Vernis-Leather-In-Magenta-4069-it.html https://www.bababorses.de/Louis-Vuitton-Ring-09-557-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-LV-Square-Espadrilles-Slipper-Sandals-Brown-6371-it.html https://www.bababorses.de/Prada-Golden-Saffiano-Calfskin-Leather-Top-Handle-Bag-it-2956 https://www.bababorses.de/Dior-Diorissimo-Small-Bag-Black-Nappa-Leather-Silvery-Hardware-8001-it-22 https://www.bababorses.de/Louis-Vuitton-Idylle-Blossom-Charms-Necklace-Q94360-406-it.html https://www.bababorses.de/Louis-Vuitton-Color-Blossom-BB-Star-Pendant-Necklace-Red-Gold-309-it.html https://www.bababorses.de/Bvlgari-Serpenti-Original-Leather-Framed-Pochette-Sky-Blue-82121-it-1938 https://www.bababorses.de/Louis-Vuitton-Horizon-55-Trolley-Travel-Luggage-Bag-Taiga-Leather-M30331-Red-6892-it.html https://www.bababorses.de/Fendi-By-The-Way-Small-Croc-Satchel-White-it-2731 https://www.bababorses.de/Louis-Vuitton-Monogram-Canvas-and-PVC-Nano-Bag-M61114-3176-it.html https://www.bababorses.de/Louis-Vuitton-Sarah-Multicartes-Wallet-M61273-Hot-Pink-7624-it.html https://www.bababorses.de/louis-vuitton-speedy-30--Damier-Azur-Canvas-n44367-2300-it.html https://www.bababorses.de/Hermes-Birkin-35cm-cattle-skin-vein-Handbags-blue-golden-it-907 https://www.bababorses.de/Saint-Laurent-Baby-Sac-De-Jour-Bag-In-Rose-Grained-Leather-it-3322 https://www.bababorses.de/Louis-Vuitton-Twist-MM-M53531-M53532-2775-it.html https://www.bababorses.de/Louis-Vuitton-Sunglasses-133-978-it.html https://www.bababorses.de/Louis-Vuitton-Neverfull-MM-M54185-Black-2705-it.html https://www.bababorses.de/Prada-Saffiano-East-West-Medium-Tote-Bag-Nero-it-3042 https://www.bababorses.de/Louis-Vuitton-Compact-Wallet-in-Monogram-Canvas-M63041-7399-it.html https://www.bababorses.de/Prada-Mens-Leather-Pouch-3312-Black-it-3099 https://www.bababorses.de/Louis-Vuitton-Women-s-Escale-Lock-It-Flat-Mule-1A7TOX-Pink-5965-it.html https://www.bababorses.de/Fendi-Baguette-Micro-Monster-Bag-Purple-Multi-it-533 https://www.bababorses.de/Louis-Vuitton-LV-Angel-Stud-Earrings-M64293-435-it.html https://www.bababorses.de/Louis-Vuitton-Damier-Ebene-Canvas-Zippy-Wallet-Evasion-M61360-7219-it.html https://www.bababorses.de/LOUIS-VUITTON-CATOGRAM-SQUARE-SCARF-MP2266-4818-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Empreinte-Triangle-Shaped-Messenger-Bag-M54330-Black-3865-it.html https://www.bababorses.de/Balenciaga-Velo-Anthracite-store-it-1723 https://www.bababorses.de/Chloe-Marcie-Medium-Satchel-Bag-Cobalt-it-2283 https://www.bababorses.de/louis-vuitton-epi-leather-Soufflot-BB-bag-m55613-black-2580-it.html https://www.bababorses.de/Louis-Vuitton-Dauphine-MM-M55735-4512-it.html https://www.bababorses.de/Louis-Vuitton-Crafty-NeoNoe-MM-bag-black-M45497-2980-it.html https://www.bababorses.de/Louis-Vuitton-Men-Box-Bag-Shoulder-Body-Bag-M44157-Brown-3136-it.html https://www.bababorses.de/Prada-Saffiano-Double-Zip-Executive-Tote-Bag-Gray-it-3025 https://www.bababorses.de/Louis-Vuitton-Epi-Leather-NeoNoe-BB-Bucket-Bag-M53610-Indigo-2564-it.html https://www.bababorses.de/Saint-Laurent-Small-Monogram-Tassel-Satchel-In-Red-Crocodile-Leather-it-3158 https://www.bababorses.de/Louis-Vuitton-Iphone-Case-LV18-59-it.html https://www.bababorses.de/LOUIS-VUITTON--CLASSIC-MINI-PACKBACK-2872-it.html https://www.bababorses.de/Balenciaga-Velo-Anthracite-store-it-1723 https://www.bababorses.de/Louis-Vuitton-Monogram-Ebene-Canvas-Pegase-Legere-53-Business-Rolling-Luggage-6950-it.html https://www.bababorses.de/Louis-Vuitton-Crocodilien-Brillant-Capucines-Mini-Bag-N93429-Black-2231-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Hoodie-Jacket-Black-1526-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Coated-Canvas-Popincourt-PM-M43462--Raisin-3345-it.html https://www.bababorses.de/Louis-Vuitton-Lockme-Cabas-Tote-M55028-Black-4530-it.html https://www.bababorses.de/Givenchy-Antigona-Small-Leather-Satchel-Bag-Black-it-2432 https://www.bababorses.de/Louis-Vuitton-Monogram-Canvas-Small-Malle-Chain-Bag-3294-it.html https://www.bababorses.de/Louis-Vuitton-Epi-Leather-Zippy-Wallet-M62304-Red-7304-it.html https://www.bababorses.de/Louis-Vuitton-Iphone-Case-LV113-38-it.html https://www.bababorses.de/Louis-Vuitton-Heel-10.5cm-Eyeline-Pumps-Python-Pattern-Suede-Black-5999-it.html https://www.bababorses.de/LOUIS-VUITTON-PEGASE-LEGERE-REGATTA-N41620-MONOGRAM-CANVAS-6974-it.html https://www.bababorses.de/Louis-Vuitton-Kimono-Wallet-M56175-Pink-7437-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Tapestry-Denim-Bidart-Espadrilles-Blue-5726-it.html https://www.bababorses.de/Louis-Vuitton-Women-s-Escale-Shirtdress-Blue-1709-it.html https://www.bababorses.de/Louis-Vuitton-Montaigne-MM-M41048-Black-4597-it.html https://www.bababorses.de/Louis-Vuitton-Heel-10cm-Crystals-Call-Back-Sandals-Suede-Red-6160-it.html https://www.bababorses.de/Hermes-Bolide-31cm-Togo-Leather-Green-Bag-it-1070 https://www.bababorses.de/Replica-Hermes-Wallet-H001-Wallet-Cow-Leather-Green-it-1558 https://www.bababorses.de/Celine-Medium-Luggage-Tote-Black-Brown-White-Bag-it-2168 https://www.bababorses.de/Louis-Vuitton-Pochette-Voyage-MM-Bag-Damier-Graphite-Canvas-Pixel-N60176-Green-7278-it.html https://www.bababorses.de/Fendi-Black-Snake-Veins-Leather-With-Beige-Ferrari-Leather-Top-handle-Bag-it-469 https://www.bababorses.de/Louis-Vuitton-All-over-Monogram-Sleeveless-Belted-Dress-Navy-1375-it.html https://www.bababorses.de/Louis-Vuitton-Ring-02-560-it.html https://www.bababorses.de/Louis-Vuitton-Iphone-Case-LV32-76-it.html https://www.bababorses.de/Louis-Vuitton-Dauphine-MM-M55071-Blue-4511-it.html https://www.bababorses.de/Louis-Vuitton-Supreme-Iphone-Case-White-Red-212-it.html https://www.bababorses.de/Louis-Vuitton-Epi-Smooth-Leather-Twist-Shoulder-Bag-MM-Pink-Black-2639-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Empreinte-Leather-Cosmetic-Pouch-Bag-M80502-Bouton-de-Rose-Pink-By-The-Pool-Capsule-Collection-4296-it.html https://www.bababorses.de/Louis-Vuitton-Bracelet-21-271-it.html https://www.bababorses.de/Louis-Vuitton-Heel-9.5-cm-Star-Trail-Ankle-Boots-Black-5511-it.html https://www.bababorses.de/Louis-Vuitton-Geronimos-Belt-Bag-M43502-Black-Epi-Leather-2646-it.html https://www.bababorses.de/Louis-Vuitton-Damier-Ebene-Canvas-Vavin-Chain-Wallet-N60222-Bordeaux-Red-7221-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Empreinte-Leather-Zippy-Coin-Purse-M80408-Cream-Saffron-By-The-Pool-Capsule-Collection-7741-it.html https://www.bababorses.de/Louis-Vuitton-Vintage-Monogram-Vernis-Bleecker-Box-Top-Handle-Bag-Burgundy-4172-it.html https://www.bababorses.de/Prada-Saffiano-Mini-Galleria-Crossbody-Bag-Beige-it-2708 https://www.bababorses.de/Louis-Vuitton-Sunglasses-39-1042-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Canvas-Leopard-Print-Onthego-Tote-Bag-M44674-Black-White-3232-it.html https://www.bababorses.de/Louis-Vuitton-Epi-Leather-Twist-PM-Bag-with-Crystal-embellished-Chain-M55412-White-2630-it.html https://www.bababorses.de/Fendi-Chameleon-Red-Cross-Veins-Leather-Tote-Bag-it-488 https://www.bababorses.de/Louis-Vuitton-Monogram-Canvas-Onthego-Tote-Bag-M44571-Kaki-3270-it.html https://www.bababorses.de/Fendi-Earth-Yellow-Leather-with-Multicolor-Striped-Fabric-Shopping-Handbag-it-771 https://www.bababorses.de/Louis-Vuitton-Croco-Pattern-Petite-Boite-Chapeau-Bag-Black-4090-it.html https://www.bababorses.de/Prada-Saffiano-Small-Double-Handle-Tote-Bag-Light-Gray-Pomice-it-2849 https://www.bababorses.de/Louis-Vuitton-Lvxlol-Speedy-BB-M45202-Golden-3125-it.html https://www.bababorses.de/Louis-Vuitton-Gloria-Flat-Open-Back-Loafers-Monogram-Canvas-5798-it.html https://www.bababorses.de/LOUIS-VUITTON-BREA-PM-Monogram-Vernis-leather-IN-MORDORE-4074-it.html https://www.bababorses.de/Replica-Hermes-Steve-H2810-Ladies-Shoulder-Bag-Cow-Leather-it-1428 https://www.bababorses.de/Louis-Vuitton-Noe-bag-M42226-Brown-3496-it.html https://www.bababorses.de/Louis-Vuitton-Damier-Azur-Canvas-I-2260-it.html https://www.bababorses.de/Christian-Dior-Multicolor-PeachYellow-Zipper-Wallet-118-it-223 https://www.bababorses.de/Fendi-By-the-Way-Small-Tricolor-Satchel-Bag-it-2916 https://www.bababorses.de/Prada-Medium-Vitello-Diano-Open-Tote-Bag-Pomice-it-2728 https://www.bababorses.de/Luxury-Hermes-Wallet-H001-Unisex-Wallet-it-1598 https://www.bababorses.de/Louis-Vuitton-Iphone-Case-LV42-104-it.html https://www.bababorses.de/Prada-Saffiano-Small-Gardeners-Tote-Bag-Blue-it-2803 https://www.bababorses.de/Louis-Vuitton-Sac-Tricot-Bag-Epi-Leather-Red-M52805-2736-it.html https://www.bababorses.de/Louis-Vuitton-Crazy-in-Lock-Strass-Bracelet-Silver-316-it.html