4 ms·
In this specific case if (a) { print(a) } and if (a) { print(a) } Could just be if (a) print (a) Except in perl, wh
by isostatic 9y ago
In this specific case
if (a) {
print(a)
}
and
if (a)
{
print(a)
}
Could just be
if (a) print (a)
Except in perl, where it's
print (a) if (a)
And if you want to add a second line you have to change it, thus I got into the habit of
if (a) { print(a) }
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.
- MaulingMonkey 9y agoI do like one-liner conditionals (at least short ones for early bailout) but sadly my coworkers and their coding standards do not.