News for hackers. Stuff that matters.
Re:Linus Torvalds: 'I Do No Coding Any More' by zabzonk on Sunday July 05, 2020 @12:53PM (#23740062)
> Not written in the particular arbitrary style that I'm used to

Like "arbitrary styles" such as "a function shall not be 500 lines long".

Re:Linus Torvalds: 'I Do No Coding Any More' by Retric on Sunday July 05, 2020 @01:04PM (#23740130)
An individual function can quite reasonably be 500 lines long. A giant case statement handling routing is one example. More controversially, if I am gong to need to do a lot of ugly compatibility hacks then I prefer to consolidate them and thus keep most functions clean.
Re:Linus Torvalds: 'I Do No Coding Any More' by awinder on Sunday July 05, 2020 @01:48PM (#23740446)
Cyclomatic complexity is one of the more well-rigorously studied measure of code quality, I don’t know if I’d pick that hill to die on.
Re:Linus Torvalds: 'I Do No Coding Any More' by rcxdude on Wednesday July 08, 2020 @06:38AM (#23768616)
It's rigorously studied but it's a crap thing to put an arbitrary restriction on, because it doesn't correlate well enough to warrent that. If you put a restriction on it, bad code still gets through fine while some good code gets made worse to bypass the checks (the biggest one is large switch statements acting as dispatch: Perfectly understandable, but if you split such a thing into multiple functions magically the cyclomatic complexity goes down to satisfy the linter but the code has just gotten harder to understand for static analysis and humans alike).
Re:Linus Torvalds: 'I Do No Coding Any More' by nemetroid on Sunday July 05, 2020 @02:01PM (#23740554)
A function can be five hundred lines long without having high cyclomatic complexity.
Re:Linus Torvalds: 'I Do No Coding Any More' by Retric on Sunday July 05, 2020 @07:11PM (#23742967)
The average size of functions is independent of the programs total cyclomatic complexity.
Re:Linus Torvalds: 'I Do No Coding Any More' by burfog on Monday July 06, 2020 @01:35AM (#23745017)
John Carmack, the famous Id Software programmer, tried it out for a few thousand lines of space rocket code, and he liked it. He argues why giant huge functions can be good for maintainability:

http://number-none.com/blow/john_carmack_on_inlined_code.htm...

Previous HN discussions about that:

https://news.ycombinator.com/item?id=12120752

https://news.ycombinator.com/item?id=8374345

https://news.ycombinator.com/item?id=18959636