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

> I don’t think any such benchmark should exist.

wing-_-nuts says (emphasis added) “My personal benchmark for 'MAYBE this function is too long' is when it doesn't fit on the page.”.

I think that’s a fine heuristic. Long functions can be fine, but longer functions tend to be less testable, so you should try to avoid them.

On the other hand, it can take lots of thinking to properly decompose functionality, and that decomposition can easily change when requirements change, so spending that time may not be worth it.



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

Search: