3 ms·
> it's getting from what needs to happen to how to decompose into classes/methods/libraries Perhaps the problem doesn't fit into an object oriented solution.
by weavie 11y ago
> it's getting from what needs to happen to how to decompose into classes/methods/libraries
Perhaps the problem doesn't fit into an object oriented solution. You could try learning a functional language and see if you find it fitting better. I struggled for years with OO and was never happy with my solutions. Learning functional was my road to Damascus experience.
If you have to go OO, there have been plenty of people who have thought long and hard about how to make OO a suitable solution. Some classic books you may want to consider :
- Design patterns : elements of reusable object-oriented software (Gang of four) - there are people who swear by this and turn it into their hammer for which everything becomes a nail.
- Patterns of Enterprise Application Architecture (Martin Fowler)
- Refactoring: Improving the Design of Existing Code (Martin Fowler and Kent Beck)
- Growing Object-Oriented Software, Guided by Tests (Steve Freeman)
- porker 11y ago> Perhaps the problem doesn't fit into an object oriented solution. Or if not the problem, then my brain. > You could try learning a functional language and see if you find it fitting better. I come from a physics/science background; what I've seen of functional languages feel natural. I bought my first book on design patterns 12 years ago (Head First Design Patterns). I worked my way through and it didn't make sense. I've dipped into PoEAA and Gang of Four since, with the same problem. The flow-chart-esque (UML) diagrams, the way messy life is meant to fit patterns... it didn't gel. Time to try again, but I fancy learning a functional language first :)
- nerdy 11y agoI reject the idea that this is an OO problem. These same problems would exist in the form of functional programming, except it would be "functions" instead of "methods"
- mistermann 11y ago> I struggled for years with OO and was never happy with my solutions. Learning functional was my road to Damascus experience. Is there anything you could recommend reading that might show how a non-ridiculously-trivial example might be done in a functional language compared to an OO language? The "OO world" seems to me to becoming increasingly unintuitive so I'd be interested to look into something that makes me feel less crazy.
- haxeny1 11y agoI would add - Object Oriented Software Construction (2nd. Bertrand Meyer) I would recommend Eiffel if you want to elevate OO design. The issue with the GOF book that I have is that there is a slant towards composition as opposed to inheritance. When done right inheritance does result in compact code. Multiple inheritance cannot be avoided (Scala proves this by trying to bring in traits). Repeated inheritance actually helps reduce the code size as one could inherit the same method twice to implement a doubly linked list from a single linked list. Note: In functional paradigm (Haskell) composition over inheritance makes sense, though in object oriented languages choosing an approach that has a compositional bias can impose some constraints that could be avoided otherwise.
- porker 11y ago> Object Oriented Software Construction (2nd. Bertrand Meyer) That was the first programming book I ever bought! Sad to say it's sat unread on the shelf for 13 years...