Live data from Hacker News

Ask HN: How do you deal with 2000 line functions?

news.ycombinator.com

71–72 of 72 posts

Re: Ask HN: How do you deal with 2000 line functions?

#71
post #69

Earlier quoted context omitted.

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.

Re: Ask HN: How do you deal with 2000 line functions?

#72
post #69

Earlier quoted context omitted.

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.

Post reply on HN