Monday, August 03, 2009

Want to Learn OO?

Last week Ben Nadel posted an entry detailing how to win a free ticket to CFUnited, which rocks. Since I am giving 4 different presentation I didn't figure I was eligible for a free ticket. I resisted posting my anticipated topic, which is probably Living the in Cloud from Sean Corfield (which I will be missing the first time through thanks to my Fusebox presentation) or Thinking outside of the ColdFusion Box. I digress though, in reading the comment stream from Ben's entry (how you enter by the way) I've noticed a pattern that many of the respondents are wanting to learn more about OO. I find this so funny since we've all seen recently how evil OO can be. I have not really weighed in and I will, mostly, not weigh in on that subject. If you choose you would like to learn OO and have not been scared away!

Welcome to the Treadmill

Learning OO is admirable and hard, we've seen this detailed hundreds of times. The world is full folks using the big D word (depends) and many folks on the treadmill known as learning OO. You see learning OO is not a steep learning curve it is a treadmill. You feel like you are getting no where because not matter what you do you really are getting no where. Don't give up on me yet, let's think about this for a second. You don't get on a treadmill to get somewhere, if you do you are indeed a moron. You get on a treadmill to get fit, stay in shape, build stamina etc.. Learning OO does not allow you to build anything new or different than before. Don't think that once you have learned OO you will magically have a different end result. You will not. The end result will be the same, a functional application. Now how it is accomplished will be drastically different but the end result is the same. What the hell does this all mean? Well a couple of things really.

Setting Expectations

Firstly if you want to learn OO just do it. Not just learning OO but give OO it a try and accept what ever comes out*. Remember this is a treadmill, there is no end only more running. If you get tired, annoyed or are otherwise not seeing the results you want get off the treadmill. Try something else for a while, and maybe you can come back and try again later. Next time you try though remember there is no end and learn from what you did last time. Maybe this time you can push yourself harder or dig a little deeper, or maybe now you have a new pair of shoes (but let's face it shoes may help on a real treadmill but typically when I program I don't wear shoes).

Secondly, and this one is a bitch, you can not learn OO in 50 minute increments by listening to community leaders. No matter how great the presenter's OO foo is there will be so much context, back story and other situational circumstances encapsulating everything he/she divulges that you will inevitably misinterpret what he/she is saying at least 40% of the time. If you want to learn OO going to presentations like this is like drinking an energy drink; it is great for a short jittery unfocused burst of learning OO but it typically is no help in long term commitment to learning OO.

Should this discourage anyone from going to these types of presentations? Heck no, just know what to expect and know that you have to focus that energy on 1 concept at a time as you learn. You should also try to learn/attend presentations that are more focused and/or that teach critical thinking skills. While some presentation or practices will not mention anything about OO they will indeed go a very long way in enabling you to learn OO.

Red Bull Presentations

So what presentation might one visit to learn the skills to use to learn OO? You may think oh hows about your presentations on Java. Java is OO that will enable me right? Nope that'll screw you up, bigger than life. Do not go into learning any other language with the hopes of learning how to program OO in another (drastically different) language. That's like trying to kick your smoking habit by increasing the amount of alcohol you consume. Might sound good at the time but it's just gonna fuck you up more in the long run. There are good reasons to learn Java wanting to learn OO in an "OO language" is not one of them.

Design Patterns for ColdFusion that has got to be an enabler right? Nope, sorry it's an energy drink. Presentations like this are good for you if you've been on the treadmill for a bit; you know where your pulse is accelerated but you're still trying to find your rhythm. If you've been playing OO for a while but don't have that background or know a design pattern or 2 but don't quite grasp why or how these design patterns are use these types of sessions greatly help in clarifying and possibly introducing a new design pattern. The reality is it's buck shot, it's a spray of design patterns, if you try to pick them all up you are being unfocused, yep energy drink. Most design patterns warrant their own sessions to really allow the exploration of real life examples on how they solve a problem. Maybe next year we can have an evening of Design patterns with 25-30 minute BOFs (not presentations, BOFs) discussing a single design patter, and have 2 or 3 BOFs a night.

Getting the Tools to Fish

Enough with the what not to go to, you want to learn OO right? At least at first take language out of it, that's what a good enabler will do. These are learned skills that are not specific to a language. Note: I said at first sooner or later language is key to understanding what concepts to even attempt. A Presentation like Design Diagrams for CFCs and Databases is an enabler. This helps you learn the language of OO. What's the point of attending a design patterns presentation if you are not even going to entirely capture the real meaning of some of the words used? The beauty of learning the language of OO and how to design is you don't even have to code to see if your OO concepts you are learning will hold up. If you can diagram you can make a system with pretty cave drawings first and see how well it will work.

Next one of my topics Red Green Refactor. Learning how testing works and why testing produces better code really can empower a person. Beyond improving code this gives you a mechanism to learn anything. I've found, as have others, when I want to learn a new language first thing I do is figure out how to write tests. In respect to OO, what you will find is that Tests, and TDD, allow you to first hand interact with the Objects you create. Its like a UAT for your objects. The theory is if I write a testable object I've written a better object. Sometimes reality begs to differ but at best I've written very nice Objects, at worst I now have tests that will help ensure my API and functionality is the same when I go back to refactor it later. That is pretty empowering and really helps you get off that treadmill of OO for a bit and pick back up later without concern of tripping on your shoe laces.

Lastly, and admittedly this is a bit of a buck shot presentation, John Paul Ashtenfelter's Thinking Outside the CF Box will do just that bring you into a different world that forces you to think differently. I say earlier you should never learn another language with the motivation of learning a concept to apply somewhere else (don't learn Java so you can do OO in CF). That being said learning how other languages operate or how life is made simpler elsewhere can really open your eyes and help you think differently about how you solve today's problems in today's language. Learning concepts elsewhere is a good idea you just always have to make sure you temper those ideas and apply them (or not) in the proper way of the language you are working with at the time, otherwise you end up with interfaces in CFML.

Everything has it's place

I want to stress that all the presentations bring great value to the community. However, you need to know yourself and your comfort level and attend appropriately. Obviously I think learning Java is a great idea but the context/motivation for learning it is not learning OO it is learning it to leverage it in ColdFusion, or learning another skill set to increase you value in the technology community. Presentations on OO or OO concepts like design patterns help re-enforce what you are trying but unsure of, it also may provide the little extra boost of energy you need. Good luck to all that entered (hell the drawing will have happened by the time i publish this) and good luck to all that attend. If they will help please attend my sessions, I hope to see everyone at the bar sooner or later.

*I've shared this story before but my first attempt at OO was back in ColdFusion 6.0 and I cfincluded my first object on the page. I quickly learned how stupid it was to do this and that I really failed miserably at OO but I learned and got better. The key is I just tried and learned, I'm still on the treadmill.

No comments: