4 ms·
> My policy: OOP is like salt. Use little and that's great. I only allow a single inheritance layer, and ideally no inheritance at all. That's been my observat
by sbacic 5y ago
> My policy: OOP is like salt. Use little and that's great. I only allow a single inheritance layer, and ideally no inheritance at all.
That's been my observation as well - there's no free lunch and DRY isn't free either, certainly not if you use inheritance chains to achieve it.
I'm starting to think that the only programming axiom that will survive in the end is KISS.
- junon 5y agoKISS and YAGNI are like yin and yang for me.
- suzzer99 5y agoA few weeks ago some commenter here said they ascribe to WET - Write Everything Twice. Basically worry about abstraction when you get to number three. And what an acronym given the context!
- hprotagonist 5y agoI've also heard "We Enjoy Typing"
- agency 5y agoThat’s great, and jives with my experience. You probably don’t know the problem well enough to come up with the right abstraction until at least example #3.
- paraknight 5y agoI've never heard this as an acronym, but I use it in practice! For me, it's an extension of "three or more, use a for" that made sense for all repetition and not just loops.
- Cthulhu_ 5y agoOr to paraphrase some sayings / one-liners, "a little copying is better than the wrong abstraction".
- joseluis 5y agoI love this. And I like it's also consistant with the findings of the natural semantic Metalanguage. NSM would be the minimum element set of concepts shared by all human cultures, which can be used to derive the rest of concepts, and it's heavily based on anthropological field studies. And it includes the numbers one, two and many, (also few, some & all). So that indicates some special meaningful distinction for us in that jump from two repetitions to start abstracting away.
- marcosdumay 5y agoKISS is universal, not only to programming. But the single responsibility principle and the idea that you should divide your code in components where the lower components should be abstract by the point of view of the higher ones are almost never wrong. Not by coincidence, those last two are consequences of how people think. While KISS is kind of a physics law.