From: Mark Hurd on 29 Mar 2010 00:07 "Cor Ligthert[MVP]" <Notmyfirstname(a)planet.nl> wrote in message news:OEf%23FG$yKHA.5040(a)TK2MSFTNGP02.phx.gbl... >I agree with that guy, YOU want to change rules which are already more >than 5000 years old. > > Which does not mean that in complex situations I simply set some > parentheses. > > Although I then mostly earlier break up the code with some more ifs. > > But the guy is right. > > Cor If you were talking about the basic arithmetic operators, */ +-, you'd be right, brackets are almost always excessive. But for And and Or I believe there have been computer languages that have a precedence opposite that of Basic (however I couldn't find them with a quick Google search). When you think about it a bit And binding more tightly than Or /does/ make sense, but it isn't anywhere near as definite as multiplication and addition (admittedly probably because we get taught BODMAS -- or one of the variations described in Wikipedia -- very early in school, where as Boolean algebra might not be formalised until Uni). -- Regards, Mark Hurd, B.Sc.(Ma.) (Hons.)
From: Cor Ligthert[MVP] on 29 Mar 2010 03:52
> But for And and Or I believe there have been computer languages that > have a precedence opposite that of Basic (however I couldn't find them > with a quick Google search). > Most probably has somebody created that, but those had probably all a very short lifetime. The Or and And in Visual Basic have no short circuiting, which the OrElse and AndAlso have. This is rare in current program languages but that is not about this. |