Hacker News new | ask | show | jobs
by odonnellryan 3807 days ago
Needing to be longer than five lines? What's your limit?

I can see some view functions being a bit more, but that's boilerplate.

A function should do one thing. It's really, really hard to do one thing in more than a few lines.

1 comments

Just take a look at any OS/graphics/machine learning/etc. codebase.
Okay, I have.

I haven't seen any code that could not be refactored to be clearer and shorter. Not being a dick, but five lines is a lot.

What about any of the functions here: https://golang.org/src/sort/sort.go

e.g. symMerge(), quickSort(), etc.