ScanIAm wrote:


Also, don't let OOP run your world.  Your job is to write software that does stuff.  It may be neat to completely encapsulate every object in such a way that Dog inherits from Animal, but if, right now, you only need a Dog, don't waste time working on Animal. 

Chances are, you'll know when you need to use inheritance because you'll find yourself writing similar code on similar objects.


Spot on.

I found that after learning about Design Patterns I suffered about 6 months of pattern-itus where everything I wrote had be use design patterns.

That's why I recommended the Refactoring to Patterns book specifically -- it's about getting working code first and then patternising it when it's needed (same with Fowlers Refactoring too, but Refactoring to Patterns is more explicit about this).

The main programming philosophy I follow is:
1. Get the code working
2. Make it faster, smaller, and easier to maintain, if that is what is needed.

This is also why I like Test Driven Development -- it makes the refactoring easier with regression testing.


Hebrie

With all these book referrals, maybe I should set up one of those Amazon pass-through sites to make comission Smiley