Re:Prefer duplication over the wrong abstraction
by nerdponx on Saturday July 09, 2016 @12:00PM
(#12061871)
I think the point of the article is that, if you aren't totally sure that an abstraction is correct or justified, then it's better to avoid building one in the first place. Not saying to never make mistakes, it's highlighting a particular kind of mistake that people don't always think about, and suggests that you can avoid making this mistake by not being so obsessive with DRY
[ Parent
| on HN ]
Re:Prefer duplication over the wrong abstraction
by js8 on Saturday July 09, 2016 @12:10PM
(#12061929)
I think such conservative approach can be justified when working on existing code, which has been somewhat proven to work. But I don't think it's justified when you're building the code.
I simply don't think you can always get the good abstraction right. But if you don't attempt it, you will never get it right. What you're advocating is not attempting it.
Re:Prefer duplication over the wrong abstraction
by ktRolster on Saturday July 09, 2016 @12:41PM
(#12062091)
If it's new code, and you are unsure what abstraction is needed, build the simplest abstraction possible. YAGNI
That way, as the code develops, and it becomes more clear what is needed, then you can easily build it at that time.
If you have code that needs to be duplicated, throw it into a function, a lightweight and powerful abstraction.
Re:Prefer duplication over the wrong abstraction
by js8 on Saturday July 09, 2016 @12:57PM
(#12062190)
That's what I am advocating in this thread. ;-)
Re:Prefer duplication over the wrong abstraction
by smcl on Saturday July 09, 2016 @12:22PM
(#12061993)
I think the point of the article is to catch eyeballs and get shared because "I'm pleased to announce that I'll be teaching a public Practical Object-Oriented Design course in San Francisco on May 9-11, 2016" ...