Rip's Domain

ColdFusion is not Java.

Posted in ColdFusion by rip747 on September 14, 2007

Maybe I just didn’t have the balls to be the first to say it. Derek’s post has inspired me and at risk of being flamed and hated (again), I want to go on record with my opinion.

Little background. About 3 months ago I got a side gig to create a web site for my friend’s company. Now I had a while to do this job since there was really no rush. During this time I was really drinking the kool-aid with all of the kewl frameworks and design pattern ideas out there and wanted to try to incorporate at least one of them into this project. At the time I figured that if I could utilize these it would make my life easier when it was time to start maintaining the code and added features.

With that I started looking and planning. I already had an code generator to handle the CRUD crap, so all I really needed was something to tie all my logic together. With that I looked at using an MVC framework since most are very mature frameworks and widely used.

So I download the framework and start playing and playing and researching and reading and posting to the forums. There were a lot of hurdles to get over and thankfully the framework’s community was extremely helpful and they really did guide me through the many pitfalls I got myself into.

However something didn’t feel right. Here I was now a month into the project and I was still struggling with all the framework’s logic and design patterns. All this stuff was really slowing me down, way down. I knew that it would take sometime to get the feel for everything but here I was 4 weeks into the project and had yet to complete the administrative backend to it. Now granted, I can only work at night for about 3 hours, but still, I should have been done with this thing by now, well at least the backend (Side note: please don’t bring up scaffolding. Hate to break it to ya, but scaffolding doesn’t fit the bill for everything).

I got really frustrated and decided to scrap the whole thing and threw it out the door and didn’t touch the project for the next 2 months, it went completely out of my mind.

Last Thursday my friend calls me and tell me that the project needs to be up and running on Monday. I panicked, I had totally forgotten about the project and literally I was starting from scratch. On Friday I came home and stared at blank screen for about 15 minutes and then finally said, “Fuck It!”. I checked my own little custom built framework from SVN that I’ve been using for the past 3 years and started coding.

24 hours later I was done. Totally done… backend, frontend, members section, it was all finished and ready for the client to look at. The whole site took me less than a weekend to do.

What was the point of that story? The point was to demonstrate how I got caught up in the latest and greatest design pattern hype and paid for it.

For so long I’ve been reading posts by people about using all this crazy crap to try to build a web site and I’ve been biting my tongue, saying to myself, “Are these people fucking nuts?”. Why is it that ColdFusion programmers feel the need that if we’re not using a MVC framework, IOC, Service Layers, Transfer Objects, Business Objects or the 15 million other design pattern ideas that you could throw into the mix, we’re doing our projects wrong and they’re destine to fail and be hard to maintain.

Why do we put ColdFusion in the same area as Java? Further even, what makes us think that we need or even should use the design patterns written for Java? I’ll tell you why, because you and I feel that since ColdFusion sits on top of Java, that ColdFusion is Java. We’ve been fed that bullshit for so long that we can’t stop believing it.

ColdFusion is not Java. It is an abstraction layer of Java for programming web sites and hiding Java’s complexities… period, the end. It’s not an enterprise level language like Java and .Net are, yes it can work with both, but that doesn’t make it an enterprise level language. Because ColdFusion is a abstraction layer of Java, you can take the ColdFusion markup and smack on top of another language, say .Net (What do you think BlueDragon is, the ColdFusion markup on top of .Net). A better analogy for describing what ColdFusion is, would be to say that ColdFusion is like jQuery. jQuery is an abstraction layer of JavaScript, it make JavaScript easier by hiding it complexities. However, it’s very feasible that your could take the jQuery markup and ideas and put them on top of another language, say Python.

The design patterns that we’re all going crazy trying to utilize were written for enterprise level languages for a good reason. A lot of these enterprise level languages interface with many different systems and grab data from a variety of different places. As such Service Layers, IOC, Business Objects and numerous other design patterns were implemented because it does make it easier to manage and maintain. However that doesn’t mean that the web sites we write warrant the use of all or any of these ideas into it, nor should we feel that we have to be implementing these ideas into our web sites.

In closing, remember that ColdFusion was built to hide the complexities of the Java language and make it faster and easier for us to work with. Why are we trying to bring those complexities back in is anyone’s guess.

14 Responses

Subscribe to comments with RSS.

  1. Derek P. said, on September 14, 2007 at 12:06 pm

    I am glad you found my post inspiring🙂. I really didn’t expect to be received the way it was, honestly.

    Although, don’t get the feeling I am totally bashing design patterns. There is still plenty good to be said about encapsulation, inheritance, and business objects, etc. I am merely pointing out that dynamic languages don’t need to be constricted the way Java did, wrangled if you will🙂

  2. Nathan Strutz said, on September 14, 2007 at 5:10 pm

    Tony,

    Please don’t let your experiences with one framework ruin your experiences with the other frameworks. I have also had a couple of failed attempts with one framework in particular, it just seems to get in the way. Figuring it out is ok, working with it is ok, but getting things done is molasses. bah. So frustrating. Don’t let that framework dictate your view of all frameworks or OOP in CF altogether.

    I somewhat agree that certain frameworks go too far with some analogies, but they still have some great ideas that could be incorporated into other things you do.

    Some frameworks click with different people than others. Maybe you’re a fusebox 2 guy and you never knew it, maybe Mach-II 2.0 will make you reconsider your life goals, who knows. Your point of frustration may be another’s point of relief.

    Also consider that frameworks’ jobs are not to make you write applications quickly, especially not at first. They’re made to help you write applications correctly. Same with OOP. It won’t necessarily be faster to develop or to run even, but it will be easier to manage and work with teams. Then, after you’ve done it a handful of times, you’ll start to figure out all the parts you can reuse. Your applications will become nearly plug-n-play.

    One thing I disliked in your blog post was the claim that ColdFusion is not an “enterprise level language,” which as we all know is subjectable. There’s no math you can do to state that truthfully. CF’s not much of a multi-purpose language, for sure, like the Java and .NET platforms, as it’s really very targeted right at web applications. It doesn’t have a lot of low-level constructs, but that doesn’t mean it’s not enterprise. Enterprise generally means a multi-user, high-yield applications and architecture that solves problems for large companies. I know CF does that, I’ve made it happen.

  3. andy matthews said, on September 15, 2007 at 8:35 am

    Psssh…

    I fully agree with you on the complexity issue. It just seems utterly foreign to me to have a bean, a dao, AND a gateway CFC just to do one set of actions. A coworker of mine uses them for nearly everything and it just baffles me. I consider him to be an excellent programmer and so I’d really like to try and understand the reasoning behind why he does it, but it just makes no sense.

    I will however disagree with you completely that CF isn’t an Enterprise level language. My company has a 2700+ template system, written in ColdFusion, which maintains 1800+ websites in an ASP model. While we know there are problems, and things which we plan to recode, our system hums along pretty well. I’d say that’s an Enterprise level architecture, wouldn’t you?

  4. Adam Howitt said, on September 15, 2007 at 1:55 pm

    Naturally your own home grown framework is going to take you less time to use than a community framework. Home grown frameworks are designed to fit a specific need and I’m sure your SVN controlled framework was a really close match for the application you were trying to build. Community frameworks are necessarily less specific to support a more diverse range of applications. Sure they take a little getting used to and I agree that maybe you picked one that didn’t sit well with you.

    Your post seems to confuse two issues that are disparate – the complexity and value of frameworks and the similarity of ColdFusion to Java. ColdFusion IS an abstraction layer for Java but that has nothing to do with what kind of programming frameworks you build. Design patterns like MVC are a proven, repeatable solution that make sense in any language. They also make it easier for programmers to transition between languages or reduce ramp-up time.

    Moving outside of your comfort zone and exploring a new framework IS hard and sometimes the best way to learn is from someone who knows the language features. Try a different framework, try to find someone who can provide guidance but don’t blame all frameworks or even the trend to adopt industry standard design patterns because you can’t understand them.

  5. William from Lagos said, on September 15, 2007 at 2:40 pm

    Hi,

    I think your post is rather confusing and mixing up issues just as Adam pointed out.

    I stand to echo what Adam said that Design Patterns are indeed proven solutions and guides to application development in any language. but not meant to solve a specific problem, like in your case, the website you were trying to built.

    But your post does help to clarify the fact that just because you are not using a framework or a design pattern, doesn’t mean you aren’t getting the job done.

  6. Rob Munn said, on September 15, 2007 at 3:10 pm

    Of course you found your own framework easier and quicker to use than a framework with which you had limited experience.

    Also, different frameworks and patterns are suitable for different size applications. I find it easy to build small applications in Fusebox 3 using a component model for the business logic and database access. For enterprise applications, I am now using Model-Glue 2 with Coldspring, and I include all of the bells and whistles – beans, DAOs, Gateways, Managers. How far you go down that path really depends on the needs of the application.

    IMHO there is no such thing as an enterprise language- only enterprise systems.

  7. Joe FitzGerald said, on September 15, 2007 at 3:43 pm

    I think a lot of the issue is training and familiarity.

    If you are a formally trained software developer then you are already familiar with proven design patterns. They won’t take you significantly longer to code than anything else. Your custom built system that took only 24 hours to modify would have already been built using those design patterns to begin with and it still would have only taken 24 hours to complete the end product.

    I completely agree that the learning curve required for untrained coders to get up to speed with frameworks, design patterns and the like poses serious questions about whether the effort is worthwhile.

    I also agree that the scale of any given project changes the amount of benefit these more ‘formal’ coding practices provide.

    You compare your time to develop a solution using your pre-built system modified appropriately versus you learning new techniques and implementing something from scratch. I think anyone could have told you before you started the level of effort between those two choices would be enormously different.

    As a consumer of your services though, the question I’d be asking myself is whose product is better for a given price. I can guarantee you that other developers could produce a system using these more formal practices in the same time you did with your method. Smart consumers will opt for the more formal practices because, quite simply, they are better in virtually every way.

    The only real argument against them is complexity, but it really isn’t that hard to find developers that are trained and already know these techniques. Perhaps a little less so in the CF space, but even in this sector of the market, I find the consultants I need without too much trouble. And they are typically the same price as those who don’t have the training.

    Fortunately for people who don’t have formal training, most employers/customers can’t identify good code from bad code in any meaningful way and so depending upon your customer base, it simply may not matter to you.

    BTW, design patterns aren’t language specific; they are specific to problems since all they describe is an efficient way to solve a problem. You can implement them in any language.

    I do very much agree that it is very easy to get sucked into trying to use every possible “best practice” design pattern during development and end up adding a ton of unnecessary complexity to the system. But I’ll put my money on formally trained developers every day of the week and their acceptable level of complexity is likely to be much different than yours currently is…

    Lastly, I really don’t mean this post to come across harshly although I know it probably does. I think you are airing a widely held opinion by many CF developers. I think that community of developers is in an interesting position because they have two choices: a) keep going as is or b) upgrade my skills. The latter option certainly will open doors that would currently be closed, but it wouldn’t shock me — as time goes on — to see people opting for option (a) still successful in their endeavors without changing.

  8. Brian Kotek said, on September 16, 2007 at 11:59 pm

    I’d be interested to hear what you were doing for that month, trying to code the app that you then turned around and built in 2 days. Something just doesn’t sound right about this. Either you really just wern’t grasping the framework at all, or the underlying code that you were trying to use was extremely over-engineered. Patterns only make sense if you understand what the pattern is and why you are using it. If you just slavishly try to apply patterns to everything, not only will it slow you down, but you’ll probably end up with maintenance mess to boot. There is actually a middle ground, or a sweet spot if you will, but it depends on the app as well as the experience of the person doing the architecture.

  9. Cozmo said, on September 18, 2007 at 10:52 am

    I feel your pain and frustration. But don’t throw the baby out with the bath water. It takes more than a month of spare time exploration to get your head around these concepts. I will reiterate what people have been saying: understanding OO programming and design patterns are hard. It has taken me a good 4-5 months (on my own time) to get to the point the light bulbs started going off and things started to click. It is a totally different way of thinking and cognitive restructuring takes time. It is not after a good 6 months of banging my head against the OO wall that I have seen how this whole OO ball of wax can really help.

    My background: I just got back into programming full time after 2.5 years developing a failed business (due to matters beyond my control… sorry… Pride ;)). I too had a home brewed framework based on FuseBox. I developed code generators that create 95% of my back end code and I can crank out a web app *very* quickly.

    I have built some fairly large apps and have seen first hand why people say that procedural coding doesn’t scale. It works fine until you start changing things. After seeing one of my clients apps implode on itself due to years of constant changes I can honestly tell you that I have taken the CFWACK style of procedural programming as far as it can be taken.

    Now that I have been working with and learning OO programming for the last 5-6 months I know why and how these apps failed and how OO methodologies could have saved me from the painful maintenance issues inherent with CFWACK procedural coding. Well not fully, I still have a LOT to learn, but I have had quite a few aha moments while implementing these methodologies at my new job.

    My advice. Keep plugging away. Your labor will not be in vain.

    No really.

  10. AGarren said, on September 18, 2007 at 9:23 pm

    ColdFusion templates and components boil down to class files. Most “native” CF objects like strings, cfqueries, structs, etc., have a host of Java methods that can be utilized when necessary. Technically they *are* Java objects. ColdFusion generally sits on top of a J2EE application server and utilizes JDBC for its database connectivity. If it walks like a duck…

    The key is that ColdFusion tries its hardest to hide all of the sharp, pointy, pieces of the development process that Java and J2EE are only too happy to swamp you with. This is a Good Thing and generally makes it very easy to develop a solution for a particular class of problems. By hiding the “hard-stuff” and by being very good at quickly providing a solution for these problems, CF eliminates the need for some of the design and architectural patterns that you’ve described (and that many of todays frameworks seem so keen to implement).

    However, in my experience, as the complexity of your problem increases, so too does the likelihood that it might be solved better by something else.

  11. Jim said, on September 19, 2007 at 1:13 pm

    I struggled with my first Mach-II application but I would never go back. What happens when for whatever reason you are no longer able to support your application and someone else needs to maintain it? Will they be as familiar as you are with your home grown approach?

  12. dan plesse said, on October 23, 2007 at 1:26 pm

    I agree totally but I still believe that using java with coldfusion is easy and at [removed] shows all my examples of things you can do with java on a coldfusion server.

  13. rip747 said, on October 23, 2007 at 2:29 pm

    @dan,

    sorry to edit you comment but i don’t promote people trying to sell their code to others. if it isn’t open source i’d rather not link to it.

  14. beautiful Minds said, on December 14, 2007 at 7:52 am

    Hei.., Diary of a programmer?😀 interesting.. Pss.. A software QA will always be interested in what a programmer have written.. ha ha..

    Rip.. that’s a fair policy that u wont link to non opensourced projects and codes..

    Keep going man.. Tc.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: