OO Can't Ruin Businesses, but People Can

Blogging newcomer Marc Funaro made a provocative first post over the weekend with his entry How OO Almost Destroyed My Business. It has gotten a lot of comments, some supporting him, and some taking issue with his conclusions. I started to comment but decided it would be better to generate a secondary discussion rather than add onto the already long thread.

Marc says he picked up ColdFusion as a non-programmer, and had good success with it until fairly recently. With the movement toward object-oriented development that is happening in the ColdFusion world, he ran into trouble. He read some books, some blogs, and took a class on Java development. And he ended up overwhelming himself with unnecessary complexity in terms of frameworks, design patterns, and OO architecture. He sums up the result of doing this pretty nicely:

"The bottom line is, when you NEED to use some OO concept, YOU'LL KNOW. *That's* the time to start writing OO-style code, and only then... not everywhere else."

Which is pretty good advice. It's something that any knowledgeable proponent of OO will tell you. I'm sorry that it took him a good amount of time and frustration to reach that conclusion, but I'm glad he finally did.

Where he goes wrong, though, starts right in the title of his entry. OO can't ruin anything, but people making bad decisions absolutely can. And what Marc did was make some bad decisions, because he was new to OO, confused, and, as he says, "downloading one framework after another, piling them all into an application". This is like reading a book on construction, and then going out and trying to build the Taj Mahal when all that was needed was a garage.

Bad decisions don't mean a person is stupid or foolish. Smart people make bad decisions all the time (I'm not conceited enough to call myself a smart person, but I definitely have made some bad decisions). Usually, it's simply a lack of knowledge or experience, or a failure to understand the implications of the choices you're making. But even that is OK, because when someone makes a bad decision, it can still have a positive outcome if it results in learning something. OO does not equate to using a framework, and it does not require the application of every design pattern under the sun. It's simply a way to organize code, manage complexity, and accommodate change. Sometimes, that is best served by using a framework like ColdSpring or Spring. Sometimes, design patterns can offer solutions to encapsulate variations in a system and cope with change. One of the key things anyone using OO must understand is that there are pros and cons to every decision, and multiple solutions to a given problem. The only way to learn how to assess these trade offs is through experience.

The reality is that a lot of ColdFusion applications don't require a massive OO system to power them. Many of the small- or medium-sized applications don't need an n-tier architecture loaded with abstractions and design patterns. But that doesn't mean that some of the good ideas of OO, like encapsulation, can't be used with big benefits. One doesn't need to turn every query into an array of objects. Just creating well-defined interfaces to expose behavior to the rest of an application will get you a long way. Once something is encapsulated, it's much easier to change it later if you need to. It might be just a few CFCs to wrap up the bulk of the logic and hide the implementation. That might be all that will ever be needed. But if (and, more likely, when) things get more complex and it comes time to start adopting a broader set of OO principles, you'll be in a much better position to do so.

However, there is another reality that can't be denied: in the debate between procedural and OO development, OO has won. It won many years ago. ColdFusion is one of the few languages left that supports procedural development to a large degree. If you want to keep being a software developer, or ever want to move to a language like ActionScript, C#, Java, Groovy, or Ruby, you're going to have to know OO. That's just how it is. And as Marc points out, even within the CF world, OO is taking over, and the number of jobs available to people without OO experience are going to keep getting smaller and smaller. Some folks may not like this and may attempt to rebel against the trend, but you can't stop the tide. OO is not going away, in fact, it's only going to get ever more ubiquitous. So it's probably in your best interest to learn about it. One doesn't have to use it on every project, nor does one have to use it to create a complex, over-engineered mess. But experience is the best teacher, both in terms of learning OO and increasing your demand in the marketplace.

So, with respect to Marc, don't do what he did. Don't try to swallow the entire OO buffet in one bite. If you try, you'll fail. You'll get frustrated. And in that red haze, you'll probably miss the simple benefits of OO. Instead, learn what you can and take time to digest the information. Experiment with it, but don't get carried away. Apply what makes sense to you where you can, in small bits. Remember that the goal is to learn, but it is also to help you do what works for you and build applications that satisfy customers.

I suppose the bottom line is: Don't be afraid of OO. Be afraid of anyone who says that OO is the only way to build an application, and be just as afraid of anyone who blasts OO because they got carried away with it and got burned.

A Slightly Late CF.Objective() Review

I'm a bit late with this, but better late than never! In my defense, the last few weeks have been pretty crazy with the conference arriving and joining Alagad. I'll be posting to the Alagad Team Blog going forward as well, but I'll do my best to keep that focused on interesting things learned on work projects, and keep my personal blog for covering my own thoughts, personal code experiments, and updates to my RIAForge projects.

With that said, let's talk CF.Objective(). Overall, the conference was excellent, which wasn't really surprising all! :-) The networking and hallway/dinner/bar discussions were always insightful. I got to see a number of friends whom I unfortunately only catch up with at conferences, like Chris Scott, Peter Bell, Barney Boisvert, and Mark Mandel. It's one thing to have email and IM chats, but quite another to be able to bounce ideas around over beers for 3 hours!

I attended several good sessions, like the Mate Framework (even though I'm a Swiz fan, Mate is pretty sweet), ColdBox, and Test Driven Development. Unfortunately, I missed the opening keynote in place of sleeping in, since my flight was delayed and I didn't get in until about 3 am and I was speaking at 10 am.

Speaking of...speaking, I did give two presentations, one on OO Modeling and Design, and one on Open-Source Enterprise Java and CF. I thought both went pretty well, though I had more time to prepare for the OO talk. I finished a bit early on the Java talk, but the Q&A session was full of interesting discussion, so all in all I think it was good. If you did see me speak, PLEASE fill out the session survey forms: OO Modeling and Design and Open-Source Enterprise Java and CF. I really do read what people have to say and try to use it to improve my future presentations!

Anyway, next stop should be CFUnited! Hopefully I'll see many of the same folks there, as well as some friends who couldn't make it to Minneapolis, and any new folks who'd like to talk (if it's geeky, just about anything goes!)

I'm Representing Alagad at CF.Objective()!

I'm packing up for my flight up to Minneapolis and am looking forward to seeing everyone and delivering my presentations on OO Design and Open Source Enterprise Java with CF! I also wanted to mention that I'm joining Alagad full time next week, so I'll be representing them and wearing some of their swag at the conference. I will still be contracting at Broadchoice to help them with the Workspace product, but won't be an official employee any longer.

After the conference, I'll find more time to blog, now that the move is over (both to Alagad and into a new house!) It's been a crazy few weeks!

SilverFlash Beta Released: A Joint RIA Platform from Adobe and Microsoft?!

Microsoft and Adobe just announced the public availability of a joint RIA platform called SilverFlash. While it is only in early beta, and the future plans are somewhat vague, this looks like it could be something quite interesting for Flash and Flex developers for several reasons.

First, it actually goes far beyond Microsoft's current Silverlight platform, in that it actually merges the Flash platform with the Windows Presentation Foundation (WPF). In some ways this seems similar to what Adobe AIR provides, except that the WPF extends much more deeply into the Windows operating system. That means a lot more power when doing desktop integration.

But obviously the real draw here is that we'll have a unified RIA platform that is backed by all the major players in the industry (even Sun is on board) and that runs on any operating system. Just imagine: the power and ubiquity of Flash combined with the stunning calendar widgets of Sliverlight, all wrapped in a Java applet. You can download the beta at the SilverFlash Launch website. This is going to do for RIAs what the Apple Newton did for handheld computing!

Is the ColdFusion Community's Generosity Encouraging Laziness?

I've been using ColdFusion for a long time. When I started back in late 1997, I was a very novice programmer. There wasn't much in the way of mailing lists, online forums, or books. There was no Google, and there were no blogs. As a result, I developed what I'd consider a pretty self-reliant nature on the subject of programming. I had to read the documentation, experiment, and try things out. And doing this, I was able to solve my problems.

I am a member of a number of public discussion forums and mailing lists, and have been for many years. I moderate several forums and lists. Over the years, I've tried to help others by answering questions or pointing them in the right direction to solve their problems. I'd like to hope that I've helped save some people some of the pain and time that I had to go through when I was learning ColdFusion.

Lately I've been seeing a disturbing trend: a rapidly increasing number of what I will call "lazy questioners". Sure, some of these folks have always been around. But in the last six to twelve months it seems like the number of these people has been making a rapid upturn.

On the one hand, this might be good news: it seems to indicate that more new people are coming into the community. I think that's great. However, what I don't think is great is their approach to asking questions.

If you are also a member of one or more forums or mailing lists, have you also noticed the increasing number of questions like these?

  • How do I invoke a trigger from ColdFusion?
  • Why doesn't this work: <cfif IsDefined("#url.id#")>...
  • Why does my if block always run: <cfparam name="url.id" default="0" /> <cfif IsDefined('url.id')>...
  • How do I zip something in ColdFusion?
  • What is wrong with my query? [paste SQL]
  • This doesn't work please help me. [paste 300 lines of code]
  • Why doesn't this work? #XMLParse( [string with invalid xml characters in it] )#
  • Will this work? [paste code]

The list really goes on and on, these are just a few of the ones I recall seeing recently. If you're asking yourself "what's wrong with those questions?", I'll tell you: either they're horribly presented questions or they could be solved in 30 seconds just by doing a Google search or actually looking at the documentation.

So what's the problem? The next response is probably "just ignore the question if you don't have anything nice to say." That's a valid response. And it would work, provided that everyone else also followed it. But they don't. When questions like these come up (daily at this point), at least one good-natured person decides to try and help. They politely provide a useful answer. Which is admirable. I often do this myself. But after thinking about the overall situation, I've come to the conclusion that it's actually a harmful choice. Here are some of the reasons why:

First, all this does is encourage the questioner's laziness. In fact, it encourages laziness for anyone asking a question. Why would someone bother to find an answer on their own when they see they can just ask someone else and know they'll get an answer?

It also means the person probably hasn't really learned much. They certainly haven't learned how to find the solution to a similar problem when (not if) they encounter one. The old adage "Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime." has never been more applicable. Answering a lazy question almost guarantees more lazy questions in the future. The questioner is banking on the generosity of others, and allowing them to shift the time and effort onto a bunch of other people. And, unfortunately, it works.

Which leads directly into the next negative result, which is an overall decrease in the usefulness of the list or forum. Lazy questions decrease the signal to noise ratio of a resource. They take time and attention away from valid and well presented questions. And it's not just the initial answer. Often, when a lazy question is answered, it triggers a long exchange where the questioner says "that still doesn't work" or "what about this variation". In response, the kind folks answering keep feeding into it, many times offering additional information that the questioner would have discovered themselves if they had put even minimal effort into solving their problem through Google or the documentation.

In essence, I think the ColdFusion community is too forgiving of lazy questions. I might get flak for saying this, but it's true: we're too nice when it comes to this issue.

Now to be clear, I'm not saying we should be mean, or that we should stop answering questions. We should absolutely keep answering questions. I certainly will keep trying to help people. But anyone asking a question should understand that there is a certain minimum level of effort that should be met before you ask. To me, the minimum level of effort is:

  • Have you actually tried to run the code? What was the result?
  • If there is an error, be able to provide the exact error to the best of your ability
  • Have you read the documentation?
  • Have you searched Google?
  • Have you searched the past threads/messages?
  • If the problem is SQL-related, have you run the query directly against the database, outside of CF?
  • If you plan to paste code, have you eliminated all extraneous code and limited the code to only what is involved in the problem?
  • Have you attempted minimal debugging with cfdump, cfabort, or cftrace?

This is not a lot to ask. In fact, this should be done out of common sense and common courtesy. If someone chooses not to meet this minimum level of effort, they should be met with a terse, blunt response, and NOT the answer to their question. There is a much more general and lengthy resource on this subject at the Smart Questions FAQ.

Here are a few situations where I say the questioner's laziness should be called out:

  • The answer could be found by simply reading the documentation on the tag or function, and it is obvious that they have not
  • The answer could be found with a 30 second Google search
  • The questioner is asking an advanced question on a complex subject when it is clear they have limited understanding of the subject or what they're even asking about, and they're expecting a free class on the subject (i.e. "I don't know much SQL, but how do I write this complicated query")
  • The questioner is asking if something will work when they haven't even tried to run it
  • The questioner is asking others to write their code for them
  • The questioner is pasting huge amounts of code and expecting others to sift through it

In many other communities, lazy questions are met with harsh responses that range from "RTFM" to "JFGI" to derisive abuse. I'm not asking the community to go down that road. I love the fact that for the most part, the CF community is a very open and encouraging place. I just think that a small but growning number of people are taking advantage of that generous spirit. It's time to impose some minimal expectations on those who would ask for our time and assistance.

I'm expecting this to trigger some interesting feedback (hopefully nothing too rough, but if you disagree and can point out some flaw with my logic here, by all means go for it). What do folks think about this issue, and what is the best way to deal with it?

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.1. Contact Blog Owner