31 ms·
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 thin
by odonnellryan 11y 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.
- azth 11y agoJust take a look at any OS/graphics/machine learning/etc. codebase.
- odonnellryan 11y agoOkay, 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.
- azth 11y agoWhat about any of the functions here: https://golang.org/src/sort/sort.go https://golang.org/src/sort/sort.go e.g. symMerge(), quickSort(), etc.