Skip to content

Comment on Ask HN: Functions: how long is too long?

Comments

It is probably too long at 50 lines. Turn the question around, what must the function return and start from there. The function should do no more than necessary to achieve the goal stated as the return of the function.

50 lines is long as I'd ever let it get, not how long I try to make a function. I think hearing from people about why they had to write long functions is like listening to an airplane's black box. It could provide insight on what a language does poorly.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.