5 ms·
My comments from the page, awaiting authorization: "See, what you are suggesting is actually a strong violation of the single responsibility principle as well
by donatj 11y ago
My comments from the page, awaiting authorization:
"See, what you are suggesting is actually a strong violation of the single responsibility principle as well as separation of concerns. This is exactly like the code I used to write. While it really is easier to manage when it's small, it's a naive approach that doesn't scale well.
In a real life example of what you are suggesting, our User and Building classes for instance ended up over 10,000 lines long, doing things even just tangentially related to their parents. The real kickers were the cross business object ones who required more than one. Is it on Class X or Class Y? Sometimes it would end up on both accidentally causing the angels to cry.
About two years ago we started a massive rewrite, and now we have lots of small consice objects that perform very specific tasks. They're logical, organized and dependency injected. I would never wish the reverse on anyone."
- rescripting 11y agoYes! I was lucky enough to start a green-field project recently and basically did exactly what the author is advocating against. So far it's been the most extendable, easy to read and easy to maintain project I've worked on. The author briefly mentions the Single Responsibility Principle and then tramples all over it, suggesting you put your 'code close to your data', shoving your verbs onto your models? Good luck ever refactoring. You'll have orphaned properties and methods that people are afraid to remove because they may anger the gods. You'll have flags, flags everywhere to control how your model does its work. Give me small, swappable, testable noun-verb classes any day of the week.
- marcosdumay 11y agoYou know, most code just shouldn't scale on this manner. But yes, there's some code that must. I guess the main flaw of both the article arguments and yours is assuming anybody knows a set of universal rules that apply to all software development.