Think about Loose Coupling | |
PerlMonks |
Re^2: Ternary vs. Sort vs. Maxby fullermd (Priest) |
on Aug 11, 2015 at 04:25 UTC ( [id://1138112]=note: print w/replies, xml ) | Need Help?? |
When faced with the need to write a similar construct (e.g., the condition is too long to make an easily scannable ternary or the like), I find it easier to Just Pick One and then write one conditional, like
Aside from shorter, I find it actually more descriptive, especially if the other side is an else rather than elseif; "x except when y" as a description reads just like the code.
In Section
Meditations
|
|