For almost the last two years, I've been trying to learn Object Oriented Programming (OOP) in ColdFusion. Coming from a strictly procedural background, the concepts of object oriented programming were new and wonderful and exciting and .... very difficult to truly understand. Along the way, I've read some great books like:
- Head First Design Patterns
- Head First Java
- Design Patterns: Elements of Reusable Object-Oriented Software
- Fundamentals of Object-Oriented Design in UML
I've also attended two Hal Helms "Real World OO" classes; I've watched many presentation on OO and refactoring; I've tried to build several sample applications with object oriented principles; and, I've blogged copiously on the topic of design patterns and object oriented programming in ColdFusion.
Now, two years later and what do I have to show for it? Without a doubt, I definitely have a much better understanding of some design patterns and I see how to decouple components in many cases. I am certainly a better programmer than I was two years ago, no questions asked. But, as far as object oriented programming is concerned, what I have found is that my exploration has delivered more questions than answers. Every time I think I am making progress, I come to realize that I only have more confusion over the "right" way to implement something. As such, I continue to write procedural code while trying to learn object oriented programming on the side.
After last week's OO-crisis and my shattering of what it meant for an object to be in a "valid state," I felt like I had come to some sort of cross roads. After the revelation, I felt like I wasn't making any more progress on the subject of object oriented programming. In fact, it seemed as though the few points that I did feel confident about might be totally wrong.
Needless to say, this event disheartened me. I took some time to reflect on my journey and I think perhaps it is time for me to give up my pursuit of OO-purity and simply accept "practical" object oriented programming. By this I mean that I think I need to stop wondering about the "right" way to use objects and just think about which way makes me more productive and makes my applications more maintainable. In the end, isn't it really only the later that has any practical value?
Obviously, I won't ever be closed the learning better ways of programming - I always want to know the "better" way; but, right now, I know that I am letting "Best" be the enemy of "Good." Until I can find that "best" way, I might as well employ good practices. I don't know what my next step is going to be but I think I might re-examine my OOPhoto application and see how I can refactor it.