3 ms·
> Somewhere, in the long dark ago, a bunch of people got upset about long functions with return statements peppered throughout. I got taught this matter of sty
by wwweston 8y ago
> Somewhere, in the long dark ago, a bunch of people got upset about long functions with return statements peppered throughout.
I got taught this matter of style in the context of 90s C/C++. The general idea was that many return points likely means many point of having clean up any state you've been trying to manage/encapsulate with the function... in particular the state of manually managed memory. Which probably means mistakes.
It's a reasonable argument for manually managed memory, loses much of its power once you're not. And these days, most of us are not.