The benefit is really just one I've talked about a million times before. I only write "foo =" once. This makes it much easier down the read to change the name of the variable, or if you prefer "refactor" the code.
Sponsor Sponsor
md
Posted: Sun Dec 25, 2005 11:28 pm Post subject: (No subject)
I've never used the ternary operator before... but that last example is way nicer then the equivalent if statement... I didn't ever even think of doing it like that before... nice!
wtd
Posted: Mon Dec 26, 2005 2:19 am Post subject: (No subject)
This is the beauty of expressions, as opposed to statements.