It's not a good arguement for short-circuited operators either, with or without comments. It's hard to write, hard to understand and impossible to maintain. One day the trainee programmer will get hold of it and there will be hell to pay!I'm guessing this is at least part of the reason why: foo = (x++ == (row = y * 2)) ? --y + 4 : (x *= 4 == row ? --row : row++ )); That's not real is it? If it is then I guess I'm not a real programmer!
I had to do a double take to work out what was going on there, sure. But I'm rusty with that sort of thing, so I imagine if I was doing JavaScript or PHP all day every day instead of <cf><cf><cf><cf><cf><cf><cf><cf> it'd not be much of a problem.
And I don't think that it's really any trickier to read than if the operators weren't short-circuited, do you?
I always make a point of commenting my code when there's more than a couple of discrete things going on in one instruction anyhow. For example if I've got a regex that's longer than one subexpression, I'll comment each step. Code can be as terse as you like, as long as it's explained suitably.
And that's not a good argument for recommending against using short-circuited operators.
For my 2c worth, there is sufficient support for programmers and webmonkeys in CF via CFML and cfscript to keep most of us happy most of the time. Are there options in PHP and ASP to code in two different styles in the one language? I'm guessing not... Could cfscript be improved to be more standards compliant? Undoubtably. Would I prefer MM spend their development $s 'standardising' cfsript or adding more functionality (as per Blackstone)? I'm with Sean on that one! Functionality will win my vote every time.
Very interesting to read the discussion however!
Brett B)
-- Brett Payne-Rhodes Eaglehawk Computing t: +61 (0)8 9371-0471 f: +61 (0)8 9371-0470 m: +61 (0)414 371 047 e: [EMAIL PROTECTED] w: www.ehc.net.au
--- You are currently subscribed to cfaussie as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
