Hacker News new | past | comments | ask | show | jobs | submit login

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.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: