in reply to Re: Style, *again*
in thread Style, *again*

The latter form is occassionaly useful to quickly signal to the reader that we're interested in array size, not array contents

That doesnt only apply to arrays. When comparing against literals I find using the literal on the left can make for more readable code, as it can emphasise the important part of the conditional. Just like the way it can be more readable to use $_ when doing a lot of regex work on one string. I also find an added advantage of putting the literal first in numeric context is that it avoids the problem of occasionally using "=" instead of "==", which gets caught as an attempt to assign to a read only value instead of (sometimes silently!) overwriting the variable.


---
demerphq

<Elian> And I do take a kind of perverse pleasure in having an OO assembly language...