4 ms·
> would it be better if there were half as many types but they all had twice as many fields and methods and had to get used for multiple purposes? Reminds me o
by diggan 2y ago
> would it be better if there were half as many types but they all had twice as many fields and methods and had to get used for multiple purposes?
Reminds me of this quote:
> 9. It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.
Written by Alan Perils, shared in "Epigrams in Programming" (1982): https://cpsc.yale.edu/epigrams-programming https://cpsc.yale.edu/epigrams-programming
Maybe I'm lisp-damaged, but I agree with this quote and parent, more functions (not methods) and less data structures tend to be easier to manage when things grow in scope.
- saghm 2y agoInteresting, I hadn't heard this before! My immediate reaction is that yes, I agree with principle as he states it exactly, but that's because anything with two dimensions where one of them is "1" is always going to be simpler because it's effectively one-dimensional. I don't think the comparison is fair because of that; I'd rather 100 functions and one data structure than 10 of each, but I'd prefer 100 data structures and a single function compared to that.