News for hackers. Stuff that matters.
Re:Google broke a conditional statement that verifies passwo... by gmfawcett on Thursday July 22, 2021 @04:33PM (#27923952)
This is one of those times when, for all its verbosity, Ada got it right. For boolean conjunction you must choose between writing "A and B", or "A and then B". The "and then" version is short circuiting, while the bare "and" version is not.
Re:Google broke a conditional statement that verifies passwo... by gene91 on Thursday July 22, 2021 @05:22PM (#27924508)
This is a typo of missing an ampersand. If the author were writing Ada, it would have been a typo of missing a “then”. How is it different?
Re:Google broke a conditional statement that verifies passwo... by Cthulhu_ on Friday July 23, 2021 @04:31AM (#27928500)
It's different because in C it changes a boolean comparison to a bitwise one. Is Ada's `and` a bitwise and?
Re:Google broke a conditional statement that verifies passwo... by gpderetta on Friday July 23, 2021 @05:12AM (#27928718)
For bool there is no difference between bitwise and and logical and.

There is a difference between short-circuiting and non short-circuiting and, hence the distinct operators.

Re:Google broke a conditional statement that verifies passwo... by thesuperbigfrog on Friday July 23, 2021 @12:57AM (#27927373)
The equivalent Ada code does not exist as the Ada boolean type only has a logical AND operator (no bitwise operations exist):

http://www.ada-auth.org/standards/12rm/html/RM-A-1.html#I538...

Re:Google broke a conditional statement that verifies passwo... by shawnz on Thursday July 22, 2021 @04:40PM (#27924028)
Visual Basic also has this distinction (but the keywords are "And" and "AndAlso")