2 ms·
I think this seems a little too existential. What is more important, that you classified the right nouns and verbs in your Paws and Dogs, or that your code wor
by asveikau 13y ago
I think this seems a little too existential. What is more important, that you classified the right nouns and verbs in your Paws and Dogs, or that your code works?
In my view OOP is all about sane interfaces between components. In your internal code however, you should feel free to let your implementation details and data structures drive the flow, and not con yourself into writing OO spaghetti, that type of code written by inexperienced types who "heard somewhere to use classes" and can only think in classes, and the abstraction serves to obfuscate rather than clarify.
- AlisdairSH 13y agoAfter years of software design, I can say with a high level of confidence that classifying the nouns and verbs properly is a prerequisite to quality OO code (from both a functional AND longevity standpoint). If you fail to do that up-front analysis, you may end up with functional code. But, the likelihood that it is readable, maintainable, extensible, etc is much lower. This isn't to say that all good code is OO. Only that writing good OO code requires you to define the objects andt their interactions well.
- CraigJPerry 13y agoHere framing the problem around a Walk class makes for a more elegant implementation but the proscribed steps will never get you there.