I used to do a lot of object-oriented programming and found myself reading up a lot on how to do it well.
When C++ was the dominant OOP language there was a very different set of best practices than have emerged since. Some of the newer ideas I know of are BDD, internal DSLs, and the importing of ideas from functional programming.
My question is: is there any consensus on the best way to develop object-oriented software today in the more modern languages such as C#, Ruby, and Python? And what are those practices? For instance, I rather like the idea of stateless objects but how many are actually using that in practice?
Or, is the state of the art to deemphasize the importance of OOP? This might be the case for some Python programmers but would be difficult for Rubyists.
Things that are popular and important:
- Refactoring
- Test-driven development
- Closures and first-class functions
- Domain-driven design
Things that are important but not popular:
- Evolutionary design (aka continuous design)
- Refactoring beyond what's built into IDEs
- Domain and business expertise
- Conway's Law; small, close-knit teams; minimizing dependencies on other teams
- Minimizing maintenance costs over initial development costs
Things that are currently popular but likely to lead to pain:
- Domain-specific languages, particularly internal DSLs
- Behavior-driven development, particularly external DSLs like Cucumber
- Storytest-driven development / acceptance test driven development