News for hackers. Stuff that matters.
Re:I hate cut-and-paste by ajross on Monday October 24, 2011 @03:38PM (#3151210)
You're positing a false choice; it's not either-or. The proper abstraction for a cut-and-pasted 10-line function is generally an 11-12 line function, with just enough extra complexity (i.e. an extra argument or two) to capture the differences in the two implementations.

The huge abstraction with class hierarchies is an entirely different kind of idiocy. It's orthogonal to this problem. You can (and I've seen it done) cut and paste giant class hierarchies too.

There are no comments on this comment yet.