3 ms·
I sometimes agree, sometimes disagree. I don’t like magic numbers like retry(3, 1_000, 2_500) (Though sometimes your text editor and docs are good enough to h
by Waterluvian 1y ago
I sometimes agree, sometimes disagree. I don’t like magic numbers like retry(3, 1_000, 2_500)
(Though sometimes your text editor and docs are good enough to help, but I don’t like making those feel required).
I like how Python (and probably many other languages) allows for using the name of a positional arg. So you could call the exact same function but write it as retry(count=3, min_ms=1_000, max_ms=2_500) if you feel like it needs more clarity. Now you’ve got documented values that are tied to the function signature, their names have been decided for you, and they’re inline!