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

> When even though two things are expressed in some common form, they nevertheless represent something different.

This is where people go wrong trying to DRY and other refactors. Slightly forced example but

  function averagePerClassroom(total) { return total / 30; } // 30 kids per class
  function averagePerMonth(total) { return total / 30; }  // assume 30
"Oh, the function body is the same therefore lets refactor this into an "averagePer" function" expect its two completely different concepts and once the code calculates the actual days per month or once classes are no longer 30 people suddenly things need to be un-refactored, or what I see more often, is just branching off inside the new single function based on an argument flag. Horrible.



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

Search: