Re:Avoid Else, Return Early (2013)
by MaulingMonkey on Tuesday March 27, 2018 @03:02AM
(#16685980)
I do like one-liner conditionals (at least short ones for early bailout) but sadly my coworkers and their coding standards do not.
Could just be if (a) print (a)
Except in perl, where it's
And if you want to add a second line you have to change it, thus I got into the habit of But I don't code for a living, any more than I run network cables for a living, or screw things into bays for a living. I code as a tool to get the job done, most recently that was writing some perl to parse the output of a tcpdump which was outputting rtp sequence number discontinuities to see where packet loss was occurring, what jitter was going on, etc. Fast, to the point, isolate the problem (crappy juniper srx), fix the problem (replace with mikrotik ccr), job done, drink beer.