you’ll see that he doesn’t like functions to be very long. I think his rule is no more than 4 lines.
Four line functions? Sounds like a codebase adhering to that rule would end up as a nice thick function soup. It feels like… I dunno, those database programmers that like normalising databases to the Nth degree.
If you put your loops into functions then you can just use return instead of break.
And that just sounds like abusing the concept of functions to replace standard flow control that your language provides.
But hey, I use C and on the rare occasion I sneak a goto in there, so I’m not qualified to pass too much judgement.
RustySharp@programming.dev 11 months ago
An
if
statement is goto in disguise. So is a return.Some would argue having 10x 4-line functions are worse for readability and debugging than a single 40-liner, because to actually understand the code you have to jump around all over the page (another disguised goto - for your eyes!)