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

extra long functions promotes breaking them down into smaller functions.



Of course - absolutely. No-one disputes that (seriously).

The difference ends up being between a 5 line function, which does 5 simple things, and a 20 line function that does 5 simple things.

In my previous example, it was 1 line which returned either the name, or 'New Name', or else 5 lines to do the same.

In the end, not a big deal. A matter of taste, rather than judgement, I feel.


I suppose one could argue that it's one line actually doing 3 things... but anyway. Not a big deal, at the end of the day.


I guess that means you have to move that logic to it's own go file.

kinda mimics c in that way.




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

Search: