October 18, 2024 at 12:00 am
Comments posted to this topic are about the item Code Blocks
October 18, 2024 at 8:34 am
Personally I think the query compiler should mandate BEGIN END for this construction.
October 18, 2024 at 2:44 pm
We have in-house standards that say block designators are required (any programming language), even if there's only one statement in the block. Eliminates any chance of confusion (human or compiler/interpreter). Started 30+ years ago, with COBOL IF END-IF, etc. Programmers hated it at the time, but it's a QA failure now.
October 18, 2024 at 2:53 pm
I was reviewing a PR today and had a minor disagreement with the dev because I took exception to his failure to use braces (C#)
if (myVar == otherVar)
return true;
instead of
if (myVar == otherVar)
{
return true;
}
I'm sure he thought I was being pedantic but I still remember a very subtle bug caused by someone mistaking indentation for scope.
October 18, 2024 at 3:54 pm
Hahaha!!!!
October 22, 2024 at 5:20 am
As a developer, there's nothing wrong with no braces. I would prefer it look like this though:
if (myVar == otherVar) return true;
It's more obvious what's going on when it looks like this.
ewm2
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply