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

This reminds me of the policy of some of my CS professors:

If it's longer than 2 lines, it belongs in a function.

(Really guys?)

I can appreciate a few layers of indirection as being useful for maintenance later on - handling new corner cases by giving you some opportunities for making the most minimal possible change.

There's a diminishing return after a few layers, and then of course you start to make maintenance itself harder by making it harder to understand and navigate.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: