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

If it's not actually re-used then it's just making me jump around to see what's actually happening rather than reading straight through the code.



> If it's not actually re-used then it's just making me jump around to see what's actually happening rather than reading straight through the code.

Firstly, you only actually create a function either when it is being reused, or because it's functionality is a logically separable responsibility and so you factor it out for understandability.

Either way, the function should also have a meaningful name describing its purpose so you don't have to jump around to understand what's actually happening.




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

Search: