Re:Practical Go: Real-world advice for writing maintainable ...
by networkimprov on Thursday February 21, 2019 @05:41PM
(#19221247)
My critique is of single-caller functions as a documentation device, not shorter functions.
Re:Practical Go: Real-world advice for writing maintainable ...
by zbobet2012 on Thursday February 21, 2019 @07:14PM
(#19221913)
But he doesn't advocate that... anywhere. He advocates factoring out orthogonal code to get shorter functions.
The function:
does two things, and it's two lines long. The function tcp_send_message_locked (https://github.com/torvalds/linux/blob/master/net/ipv4/tcp.c...) does one thing at it's 261 lines long.Shorter code is _indicative of_ orthogonality (what he asks you to break on)__but_ it is not the same thing.