Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My own observation is that programmers have a marked tendency to assume that because two methods have similar or identical behaviour, that this implies they should share an implementation. In large code bases, its common to find methods that have identical implementations 'by chance'. By which I mean that the commonality is a side effect of requirements that could readily change.

In my opinion, the best defence against this is good documentation: if a two methods have clearly documented behaviours, then even if their implementations have been fused, a subsequent programmer will have more context (and more confidence) reduplicating the code in response to further changes.



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

Search: