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

> Since we cannot make exact predictions it’s better to make methods as small as possible instead

No, please don't. Separate your functions based on what they're doing, not an arbitrary line count. If it takes 50 lines to do what's necessary, a 50 line function is absolutely fine.

You know what isn't fine? One operation split into 50 different subroutines that are all useless on their own unless composed together in order.

Make your interfaces small, not your functions.



I agree with you, I didn’t say that quite right. In my mind this is actually pretty much what I meant, though I completely see how it can be misinterpreted. Line counts, like most other design rules should really be more like guidelines. Thank you for helping me clarify myself mate!




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

Search: