3 ms·
The part that's confusing me is the part about avoiding clutter – if you have to do all the checks anyway, what clutter are you avoiding by changing the order o
by vore 3y ago
The part that's confusing me is the part about avoiding clutter – if you have to do all the checks anyway, what clutter are you avoiding by changing the order of them?
- bee_rider 3y agoI believe the likelihood annotations are the things they are talking about, for cluttering the code. Not the argument checks.
- gumby 3y agoThat conditional would be checked, then if it failed, checked again after the normal case has run, in order to choose the arm to follow. Not a huge deal execution-time-wise, but from a reader’s PoV, the way I write it says, “ok, the special cases don’t apply to the body so I don’t have to worry that the index will be out of range (or whatever) and can just focus on the logic”.