Tags

A Challenge for ColdFusion Developers…

by Kyle Hayes on October 7th, 2007

This is a callout to all ColdFusion developers young and old whether your brand new to ColdFusion or you have been working with it for years–whether you are a seasoned programmer from another language or you have only ever written a Hello World application, I have a challenge for you.

Popular Posts

From Uncategorized

22 Comments
  1. Kyle, looks like you and I are not only thinking along the same lines but have experienced learning CF in a very similar manner. It was not until I had completed my Java classes in college that I began to ask some questions related to OO and CF. Prior to that I had been hearing some conversations in the dark corners of the CFUG meetings related to supposed CF shortcomings. I have really never considered the lack of true OO architecture to be a shortcoming of CF as I never saw CF as intending to be that in the first place. The question which comes to my mind is : Does the CF community wish for CF to be something that it is not? If so, what is it and what can the community do to implement change. The other issue which is present is the need for continued concentration on community development. This means new members, continued and greater support for improvement of existing members, and I think a greater degree of community project development. I referenced Ruby as a model for community in my blog related to this topic. Regardless, I really want to see a huge amount of community growth over the next few years. How do we get there?

  2. @doug:

    Oh good, I am so glad that someone else is there with me on my thoughts. I was kind of half afraid that I would be blind posting this hoping I was not going to get torn down.

    You brought up some very valid points. Are we pushing CF to be something that it is not? And yes, I want us to have the same kind of community that .NET and PHP and Ruby developers have. I would even go as far to say, I challenge our community to be as intense, expressive, motivated and excited as the Ubuntu community. Now there’s commitment.

  3. I was having the same reservations about publishing my thoughts on this as well. I then thought that not discussing this stuff is probably part of the problem, so go ahead and tear me down – I’m not going to take it personal any way. Plus, its my blog and I can say whatever I want (-; So far I am feeling good about the responses I’ve seen over multiple blogs. Pretty interesting that similar discussions are popping up around our community blogs….hmmm – maybe people are thinking on the same lines.

  4. Todd Rafferty permalink

    I concur. I think this has been missing for a long time. You have the WACK books, which are great for those just trying to learn and then, blam… dozens of communities revolving around either Fusebox, Mach-II, etc. There doesn’t seem to be an intermediate graceful direction between them all.

  5. As somebody who is wrestling with OO CF I agree with Todd that there needs to be more intermediate resources, but speaking as an experienced PHP programmer I have to say that I think that the online ColdFusion community is far more focused and close-knit than the PHP community. I may get shot down in flames here (by PHP people), but I think that the widespread adoption of PHP has served to water down the genuinely good resources with loads of substandard content.

    Although it took me some time to fully immerse myself in the online CF community I now have about half a dozen blogs that I read daily and provide me with all the news and support I could ask for (apart from that elusive intermediate procedural-to-OOP resource)!

  6. @James: Your type are exactly the kind of people I hope comment on this post. It is folks like you who we need to hear from. But I also found interesting what you said about the PHP community and I believe you are right.

    I had to get full immersed into PHP a few years ago when CF was not an option for a project I was working on. I was surprised at the time, like you said, how watered down it was.

  7. Totally agree Kyle–I made this comment in a blog post or article of some sort quite some time ago and I think it still holds true. When you learn Java, you don’t learn a whole ton of syntax and then learn OOP as "advanced Java." In Java literature you start with objects from day one because that’s the way you’re supposed to program in Java.

    CF should be the same way. I agree that one of CF’s major strengths is how easy it is to get into the language, so while we don’t want to lose that, we also don’t want to spend most of the time teaching people about the language features only to introduce CFCs as something "advanced." Introduce things "correctly" (IMO anyway) from day one.

    I took a Flex course recently that drove this point home. After a very simple "Hello World" example we immediately dove into custom events because they’re at the heart of well-architected Flex applications. The same goes for CF–CFCs should be introduced very early so it doesn’t turn into a huge mindshift later down the road.

  8. Todd Rafferty permalink

    I can agree with that. One thing though, just because you can do OO with CFCs doesn’t mean you have to. It’s one thing to be familiar with CFCs and use them, something else to apply OO principals to it all.

  9. @Matt and Todd: Both of you are right on this one…so…

    We need to do something about this in that we need to get developers to recognize that CFCs are integral part to developing code…and not just stop there. We then need to show them how CFCs fit in to good object-oriented design.

  10. Rand Thacker permalink

    While I agree with your sentiments, I have to interject here.

    An artist never starts off creating masterpieces. The artist learns techniques, how to apply those techniques to different medium, etc. Then, after having found the techniques and medium that they favor, that’s when they hone their skills, and eventually make incredible works of art.

    I feel that any programmer has to (learn / be taught) the proper techniques. The programming languages are tools that one leverages to create internet goodness. Each language has different strengths and weaknesses. Sometimes you choose the language based on your proficiency, sometimes the language is chosen for you.

    I guess after all this rambling, I agree with your basic premise, there needs to be a stronger drive in the CF community towards creating tutorials, example applications, etc. that focus on "the best practices".

    I’ve seen plenty of posts on creating MVC applications in most of the frameworks, and that’s all well and good. But once that "eureka" moment hit me, and I started <strong>really</strong> using CFCs as objects (instantiation, inheritance, etc.), it’s really hard to even look at some of the old code that I wrote.

  11. I have to agree with Rand, and go a little further. In any discussion about Coldfusion adoption, that it is easy to learn, and doesn’t constrain beginners is a good thing. Let people in the door, then hit them with best practices. One of the things I truly love about ColdFusion is how quickly someone can become productive. We shoudln’t get rid of that because it gives people the freedom to write crappy code.

  12. I’ve been working on a couple of Primers about moving from procedural to OO programming with Coldfusion:

    http://www.iknowkungfoo.com/blog/index.cfm/Primers

    Now that MAX is over, I’ll be adding more very soon.

    I was at Brian’s BOF sessions and had a lot of fun. Hopefully next year we can get more time for them.

  13. I too learned the "old way" of ColdFusion development. I started writing apps against CF 3 so there was no thinking of OO back then for CF. Now after learning OO concepts and using several of the frameworks available, I write everything in that manner and prefer ColdBox as my framework. So I agree with alot of what you are saying.

    However, I think we as a community, need to be careful not to put ColdFusion into a box. We have to be very careful not to over-commit to the OOCF ways of doing things and forget that one of the biggest draws of ColdFusion is its strength as a rapid application development language. Thats one of the things that pulls a lot of newer developers to ColdFusion. We as a community have to conitinue to support that as well as do a better job of transitioning those newer developers to doing things in an OO manner.

  14. @Adrian – Great to see! We need more of this kind of stuff!

    @Russ – I fully agree that we need to ensure that CF stays at the top of its game with RAD. That doesn’t mean, however, that it should be crappy code. You can do good RAD without any of the frameworks out there. As long as you are still using CFCs and functions to structure out good reusable code, you are already doing it better than the developer who writes it all in their CFM pages.

  15. I really think it’s a matter of describing what all the various constructs available within ColdFusion are best suited to, for example:
    * CFML pages: for displaying data, creating forms, etc. Not for business logic except when related directly to the view.

    * CFCs: contain business logic and as a rule don’t output anything. (I know I’ll get some blowback on that comment, but that’s my opinion!)

    * Custom Tags: great for reusing view logic, doing common formatting, etc.

    That’s just to get the discussion going. In short, I don’t think this is an either/or situation where we sacrifice ease of use and low barrier to entry for "doing things right." Even if it’s just telling people from day one to put queries in CFCs as opposed to CFML pages, and to call the method that returns a query from their CFML pages, that’s a huge step in the right direction.

  16. Todd Rafferty permalink

    I guess I’m just tired of the "If it’s not OOP’ed, you’re not doing it right." You don’t need an oversized cannon for everything you’re working on. I don’t mind mixing at times.

  17. I think more tutorials like Adrian’s would be great. But what I would really like to see is a side by side comparison of an actual app (preferably something a bit more advanced than a hello world app) done in procedural code and full-blown CF OO code. Where are the performance gains / losses? Why is there a performance difference? "Cleaner Code" is nice, but does it really get me any performance benefits? Has anyone really done any load testing on the same app done in 2 different methods?

    As a side note, I believe both methods have their place and both are necessary for CF to thrive in the future.

    There’s probably a book in all of this just waiting to be written…might only sell 100 copies, but I would buy it!

  18. Performance should not be the primary consideration, maintainability should be. A well-architected OO application is infinitely more maintainable than a procedural one.

  19. Todd Rafferty permalink

    Maintainability can be done by anyone who can organize things appropriately, coming up with a standard and such just simply hashing things together.

    * I’m 100% for separation of logic from presentation, etc.
    * I’m also 100% for making sure the applications are 100% portable, but it can be done without diving into OOP.

    My code is far from straight procedural and OOP. If anything, I think I found a comfortable balance between them. Sometimes I wonder if everyone likes making everything more complicated than it needs to be.

  20. @Todd – It’s interesting that you mention portability…

    ColdFusion applications, as they stand today, are not portable applications. They are only portable to other ColdFusion instances which cost a lot of money. Take PHP, ASP.NET, LAMP etc, which are completely free. If a company wants that, the products are free. This is of course set aside from hardware configs. We are just talking software here.

  21. I agree with Matt’s point. You don’t get into .net today as a noob and learn how they did ASP it back in the pre .net days. You should start learning the proper methodologies from day 1. In part this is because, as many of us know, it is such a difficult transition to make.

    I am really hoping this doesn’t get into another "You’re condescending about my procedural coding so I am not willing to listen" kinda debates. The truth of the matter is that the other major players are all OO. If you go looking for a serious job, they want a basic understanding of OO at the *very least*. To be blunt, this war has already been fought, and procedural programming lost.

  22. Bill permalink

    I manage a large group of web programmers and wish I could say that all of them know or understand the concepts of OO and a good framework.

    When it comes to the times of one of my developers needing to back up another (due to scheduled vacations or other reasons), I can truly say that it’s very tough for them to simply jump-in at times and take over. However, for my folks that provide web application solutions using frameworks like Mach-II, Fusebox, and Model-Glue, it’s much easier for other OO-skilled programmers to jump right in and provide support where needed – all while being very transparent to the customer (important for a manager).

    I also find it very easy for developers to write procedural spaghetti code without using a good software design and framework. I know many other companies that have these same challenges and managers are looking for OO skilled folks to join their teams.

    I am also hoping that the authors of CF books start sponsoring good concepts of OO. Like Kyle posted, I too have rarely seen object orientation promoted in the early phases of learning ColdFusion.

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS