The Trouble with OO?

Marc Funaro recently posted a blog entry called "How OO Almost Destroyed My Business". It is a good entry, inasmuch as it is thought provoking.

It is a bit long, however, so hopefully he will post a shorter, more organized entry to the same effect later. Even at its long length it is a worthwhile read. The stream of consciousness style does help demonstrate his experience and feelings.

I started to post a comments, but my thoughts ended up running a bit long.

Like the author, I have often felt that the gurus in the ColdFusion universe are pushing an OO solution. This isn't really a fair interpretation of what anyone has actually said, however.

Most ColdFusion gurus are smart and experienced and tend to be working on difficult problems. The kinds of problems that they solve are probably the kind for which an OO solution is the best kind. So, most ColdFusion gurus prefer OO for themselves. Consequently they write about doing that kind of work.

I don't think the intent is to suggest that to be "The One True Path", it is just an honest description of the work that they are doing and find interesting.

Written internet communication tends to be either brief or stream of consciousness. Either one tends to lead to writing that can be interpreted as less nuanced than intended. This blog entry, for example, seems to take the stance that all ColdFusion gurus are pushing OO and OO is always bad. Probably (hopefully), this isn't what the author intended.

In the same way, ColdFusion gurus, I think, don't intend to push OO as the only way to develop.

I have, however, seen writing in the ColdFusion universe (no, I am not going to try to find examples) that indicates that anything other than OO is procedural and implies that anything procedural is spaghetti code. Examples tend to say, "You could do without OO, but you have to copy and paste" or they talking about the benefits of encapsulation as though you can't use encapsulation outside of OO. All of this uses procedural as a straw man for "spaghetti code".

This is unfair, but also just a part of casual writing. The author of the blog, for example, may not have intended to come of as aggressively against ColdFusion gurus and OO as he seemed to do. Even the comments are a mixed bag in this regard. Some are very well thought out (see Mike Brunt, in particular). Others, even by people I know and respect, seem defensive and/or aggressive to the author's experience (he does seem to blame OO for all of his travails, after all) or cheering any stance that OO isn't the way to go.

I think many of the comments supporting the blog entry come from a feeling that OO is the only accepted way to program in ColdFusion today. I think that isn't actually because anyone says that, but rather because nobody is writing about how to develop in ColdFusion without OO.

For my part, I intend to change that.

I have a non-OO framework that I have been using internally. I haven't blogged about it because it isn't OO and it isn't fully baked. I didn't want to defend it against OO purists until it was fully baked.

This is absurd and unfair on my part. I am not giving the ColdFusion community enough credit for being even handed in its assessment of different approaches to solving problems.

I plan to start blogging about these topics soon.

Stay tuned.

Related Blog Entries

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Thank you Steve,

The points all need clarification, for sure. I am honored to have some top CF people actually responding -- to have them take the time to respond to what on the surface appears to be just a rant of a non-CS idiot that couldn't see what he was "doing to himself"... well, I'm just very appreciative.

The post is meant to stir up controversy, and (finally) some real discussion. Your response post above is EXACTLY what I hoped to see, though I would not have been able to articulate that at the time I was writing my novel. I will be posting separately about this soon, but I think the real idea here is to demonstrate to those that just cannot embrace OOP -- that their mind just doesn't work that way -- that there are ways to achieve the very same "benefits" that OO seem to have commandeered for themselves. The procedural/relational world solved some of these "problems" ages ago, but those solutions never seem to be brought up. And here, to me, you hit the nail on the head -- people are writing and blogging about OO, and nobody's writing to say "hey... guys? over here... you can get the same result by doing *this* too." So it does start to feel like the current is sweeping us all towards the OO paradigm, and once you start to feel pulled... it's easy to get frustrated and then defensive.

I'm not afraid to admit the faults in my original rant - as I said, it needs some REAL fine tuning. But damn... I'm really happy to see the conversation that has developed. That MAKES it a success to me.

Anyway, sorry to write another novel HERE... thanks for taking the time to read and respond.
# Posted By Marc Funaro | 5/26/09 6:48 AM
I don't see this as 'trouble with OO' but more trouble with developers.

If the only tool you know how to use is a hammer, than everything looks like a nail.

OO is not always going to be the best solution.
Procedural is not always going to be the best solution.
Using a framework will not always be the best solution.

A good developer knows how to use as many tools as possible.
A good developer knows when to use what tools.

Just because I may choose to use an OO approach using a framework to solve a problem and you may choose to not use a framework and use a procedural approach does not mean either of us is wrong or right.

Just because someone uses an OO approach, does not mean it is better. I have seen bad OO code.

Just because someone uses a procedural approach does not mean its better. I have seen some bad procedural code.

That being said, most often, I will walk into a project thinking that I will be using an OO approach and most likely a framework. Why? Because I like frameworks and I tend to think in more of an OO mindset - I am used to doing things that way and it may be quicker and faster for me to do it that way than using another approach. However, there have been many projects where I realized the OO approach and/or framework was not the right fit.

To me, its not just the project that should dictate the approach used, but the developer as well. I doubt you will want to use an OO approach using a framework on a large project if you are new to frameworks (or a particular framework) and not too keen on OO.
# Posted By Scott Stroz | 5/26/09 8:33 AM
Scott,

The title was just a reference to Marc's blog entry. My blog entry was intended to be about the perception that OO is being pushed as the only way to develop ColdFusion (the perception itself, mind you).

If it came off that I was discussing the pros and cons of OO itself, then I apologize for really unclear writing on my part.

I'll confess to being discouraged at having made my point so badly.
# Posted By Steve Bryant | 5/26/09 8:43 AM
Steve,

Not at all. I understood the point behind your post (I think). I just had the uncontrollable urge to reiterate my feelings here.
# Posted By Scott Stroz | 5/26/09 8:47 AM
Steve,
I think the point is to be able to choose.
You know I am an heavy dataMgr users that is not really OO and I like it but sometimes I prefer to use transfer..
The point is not OO or not the point is do not arrive to the point to use a technique just because you must fill a form.
CF is not Java. You cannot use Java with no OO approach...but you can use CF...also because too many objects really slow cf down.

Btw I think up to when you do not become fanatic you will be able to choose an approach for any project.
# Posted By andreacfm | 5/26/09 11:29 AM
"Most ColdFusion gurus are smart and experienced and tend to be working on difficult problems. The kinds of problems that they solve are probably the kind for which an OO solution is the best kind. So, most ColdFusion gurus prefer OO for themselves. Consequently they write about doing that kind of work."

That's an excellent reading of the situation Steve!

I think you're exactly right that the reason there seems to be such a focus on OO amongst "gurus" (ugh!) is because the majority of the high-profile, vocal bloggers are people who are confident about their work and their projects and tend to be tackling difficult projects - with OO and therefore that's what they write about.

I certainly write about what I know and what I do. That's nearly all OO stuff. I pretty much never tackle anything where a framework doesn't add value (for me) or where I don't see value in CFCs. Perhaps I ought to blog more about the simpler stuff I occasionally do? However, nearly all of the simple sites I work on are plain HTML or have only a handful of CFML pages in them.

I'd love to see more people blogging from the trenches with a broader variety of projects and approaches. It would definitely add more balance to the blogosphere.

One thing we all need to remember is that there are close to 800k CFers today and attendance at CFUnited, our biggest event, is 0.1% of that. There are fewer CF blogs than that (ColdFusionBloggers aggregates 499 today) and many of the mailing lists we "all" frequent have only "hundreds" of subscribers. The "community" as we see it on the web - and at user groups - is not representative of the actual pool of developers.
# Posted By Sean Corfield | 5/26/09 5:33 PM
Scott,

I understand.

Andrea,

Good point, indeed.

Sean,

Thanks. You know, I think I have seen you mention those stats on the ColdFusion "community" relative to the pool of ColdFusion developers, but I still find it surprising. It really is amazing what a small percentage of ColdFusion developers really make up what we think of as the ColdFusion community.
# Posted By Steve Bryant | 6/1/09 5:38 AM
I have been saying this for a few years, and when i said it, i got insulted, and flamed, and ended up shutting down my blog.

Why are people more concerned about what is a trend or fad, and then evaluating upon true every day usage, and does it fit our needs? Then hey XYZ is using it, so we must madly rush to apply to whatever the latest trend is...rather than using a bit of grain of salted wisdom...

However, after a few years more, i realize having a solid reliable framework, is very important. I just haven't seen one that appeals to me...

I see now the importance of seperating display from business logic, however not so that it becomes so complex, that every day people can't figure out your code, unless they are some experts...

Business Logic needs to be logical...human understandable...

But anyways, really nice article.
# Posted By Craig Rosenblum | 1/11/10 4:50 PM
Craig,

It is too bad that you shut down your blog from a negative experience. I think there is a big disparity between the percentage of vocal ColdFusion programmers using OO and the percentage of overall ColdFusion programmers using OO (as I discussed above).

ColdFusion without OO is alive and well and will continue to be so for some time now.

I know what you mean about the temptation to do what someone else is doing. For example, I think Sean Corfield is a really smart and experience programmer. As such, I am tempted to follow his example. It is important, however, to step back and evaluate whether or not he is solving the same type of problems that I am solving.

Different types of problems lend themselves to different types of solutions and several problems can be solved (nearly) equally well several different ways.

I have been remiss lately in blogging about developing ColdFusion without OO. I will redouble my efforts in that regard.
# Posted By Steve Bryant | 1/11/10 8:52 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.