News for hackers. Stuff that matters.
Re:Goodbye, Clean Code by dkersten on Sunday January 12, 2020 @05:38PM (#22030105)
Yes, I agree. That’s not what I was replying to, though. I noted in another comment that I consider merging worthwhile even in the absence of three use cases, certainly if what you have now is very similar.
Re:Goodbye, Clean Code by scarface74 on Tuesday January 14, 2020 @10:18AM (#22045478)
If all seven are the same except for one or two cases, it doesn’t mean that you have to have a bunch of if statements, you either use inheritance or composition to create special cases and judiciously apply “pull members up” and “push members down” refactoring, interfaces, abstract classes, virtual methods, etc. These are all solved problems.

Yes I know about the whole “a square is not a rectangle problem”.