After getting in a discussion about the iOS Crypto Flaw also discussed on Ars Technica, someone mentioned that they encountered a case where, the line following a bracket-less if
expression, was treated as an else
.
if (<condition>)
<expression A>;
<expression B>;
<expression C>;
So, according to the person, expression B would be skipped if the condition was true, as if the else
is implicit and unnecessary.
This in contrary to anything I've heard - my experience has been if the condition is true, then all three expressions would be executed - but seeing as I am a pro-bracket advocate, my experience may be limited, so I was hesitant to completely call the person out. Instead, I spent about 10 minutes clarifying and making sure I correctly understood what they were saying :)
Is there any truth in what they said? What language?
I'm pretty sure all major scripting languages follow my understanding. I think the person has a greater background in Objective-C. But if this is true, it could certainly be greatest reason to always use brackets.