6 ms·
Often it makes sense to have the code and the data together. I am thinking about OOP, where your classes define the data and the methods that act upon. Having
by collyw 11y ago
Often it makes sense to have the code and the data together. I am thinking about OOP, where your classes define the data and the methods that act upon.
Having inherited a new project recently I was disappointed to see the documentation talking about following the philosophy of thin models and fat controllers (the opposite of what is considered best practices for Django, which the project is using). It means that there isn't one obvious place to look for the expected functionality,there is unnecessary repetition of code and its way less efficient than it could be if it was done the other way - models with data definitions and related methods in the same place.
I am all for separation of concerns, but I don't think splitting along the lines of "data" and "code" is the best way to achieve that.