From: Dave Aronson Date: 2013-01-07T00:36:21+09:00 Subject: Re: Best practice for &&, ||, and, or On Sat, Jan 5, 2013 at 11:56 PM, Jan E. wrote: > Why would I expect that? Why would I even *use* assignments in "if" > statements? Sorry, I missed that you were specifically speaking of "if" statements. But even so: Using &&/|| in some parts and and/or in other parts, is confusing and fragile. If I have to make a complex boolean expression, and something goes wrong, I sometimes extract parts out into an assignment to a temp var, so I can grab that subexpression in a debugger. If that subexpression uses and/or, that will play merry hell with trying to get the actual value of the expression. > Sorry, but if you use assignments in "if" statements (much too obscure) Agreed, and I said so even back in my days of hacking C, where it used to be fairly common. -Dave -- Dave Aronson, the T. Rex of Codosaurus LLC, secret-cleared freelance software developer taking contracts in or near NoVa or remote. See information at http://www.Codosaur.us/.