Hacker News new | ask | show | jobs
by tinco 3808 days ago
Sorry you're right. It's 5 lines:

https://robots.thoughtbot.com/sandi-metz-rules-for-developer...

1 comments

For certain web apps, maybe that can work. Not for anything slightly more complex though.
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.

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.