This is just a reminder to folks out there who may not know it. Hal Helms, noted ColdFusion author and trainer, has an excellent newsletter that I highly recommend. The most recent newsletter (actually the last few) have been extremely interesting to those who are just beginning to enter into the object oriented world. Hal does an excellent job at taking confusing, sometimes seemingly contradictory concepts and explaining them in a way that is easily understandable.
I'd like to quote something from his recent newsletter: Let me say one more word about this, because I see too often a type of paralysis that afflicts people coming into the OO world. The affliction occurs because people are worried that they'll violate some stricture. Maybe they'll accidentally unencapsulate polymorphic cohesions. Or something. But the only way to get good at stuff is to do it.
I can't ditto this enough. I can say as a long time developer - I've experienced this paralysis many times - even more so now that we have CFCs in our toolbox. Everytime I find myself going into a "What if" spiral - I simply stop thinking about it and code. Many times I end up ripping my code apart - but getting that first draft down is an excellent way to help clear your mind. This is what I did when developing Soundings, my survey application for the last DRK.
Archived Comments
Ray,
Right on. When it comes to OO, I think a number of us are all in a learning mode, and until we get it somewhat "wrong," we'll have a hard time seeing what's "right."
I used to sketch on a white board, then code.
Now, I sketch on a white board, model in a tool, and then sketch again in code. It's not until I have that "code sketch" that I can really see where refactoring can be applied.
Somehow, I wind up producing something that works, is flexible, and is reusable, in less time overall.
Thanks Ray--this is a very important point. It's easy to get paralyzed, think all this stuff is too hard, and just keep doing things the way we've been doing it for years. The important thing is to try this stuff, watch it break all over the place, learn from your mistakes, and do better next time. This is how we all learned programming in the first place, so in some cases we just need to get back to that mindset, put our pride away for a moment, and start with a clean slate.
In the end, if what we build works then we're successful at least on that level. Then we can revisit that working code, share it with someone more experienced than ourselves, get feedback, and do it better from an "academic" standpoint the next time around.
In my opinion this is the best way to learn this stuff. I fine-tune my approach with every OO app I build, and I have a ton of design pattern and other OO books on the shelf that I've only scratched the surface of, so I still have a long way to go. If I waited until I had read all those books and felt "ready" to do OOP, I'd never get anything built!
heh,
I found myself in the last 48 hours the very same thing, litterally paraylized in this "hypotehtical" circle.
I think pattern abuse is to also blame as of late, as lot of people are ramping on about DAO/DG more so (i myself included) - yet what did we do before we found them? we simply combined the two into its own CFC maybe? Is that bad? probably not as at the end of the day you can still re-use the cfc over and over.
I guess whe thinking OO and Patterns its easier to (qoute spike here) "simply don't think about them upfront, let the code take over and reflect, refactor, reflect, refactor etc"
I also was told once when thinking in OO, think like a sculpter - have an idea of your vision and your objectives - but then start work, let the model take shape and when you think you have it, focus some more on details after you have the essence created.
I thought it was crap until late yesterday after spending 42 hours no sleep on my "perfect" oo framework... and it hit me how true that is. If i simply worked on the visuals some more and made them talk to an API layer first. I could then seperate that API into its own sub-set managers and so on..until at the end i had an object that i passed through-out.
Point was i was thinking too much in OO / pattern perfection and simply not on the actual application i was building.
Hals a genius hehehehehe
Thanks for the kind words, Ray.
It seems that for too many of us, design patterns, rather than empowering us, are actually holding us back, as Scott pointed out. It's true that there are design cops out there who await the chance to endlessly argue over -- say -- the eleventeen different ways to persist an object, and that's a shame.
Ah well, let them have their fun; we'll have ours creating really cool apps.