@cmuratori I recently started following Handmade Hero from the first episodes and one thing I noticed that you do differently to what I learned, is that you don't tend to do early returns. Is this more of a preference or do you have a practical reason for doing it this way?
-
-
Replying to @PythagoRascal
I like to have only a single return point in a function, so I can more directly reason about what does and does not get done in the function without having to see where all the return points are.
3 replies 0 retweets 21 likes -
Replying to @cmuratori @PythagoRascal
i find it common to evaluate error/abort cases at the start with several returns and then the main block is no returns until end; how do you like to approach those cases?
1 reply 0 retweets 1 like
Replying to @kalin_t @PythagoRascal
I just use nested if's, or a boolean on the handle that gets checked later, depending on the circumstance.
1:54 PM - 24 Feb 2020
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.