Kyle873 wrote:That's some pretty shit reasoning for doing that. Forcing a style like that just comes off to me as "I can't be arsed to implement it otherwise and deal with people who don't know what they're doing".
This isn't VB.NET. The language itself shouldn't accommodate shitty coders and hold their hand while it's doing it.
The only thing I was getting at was this:
Code: Select all
if(condition)
{
// ...
}
//elseif(condition2) //From this
else if(condition2) //To this
{
// ...
}
else
{
// ...
}
But like Gez pointed out it might be a problem regardless.
And what Graf has supplied, it's going to be replaced sometime anyway.
NeuralStunner wrote:Also, I'm 99% sure the commit remark is referring to if+else. Braceless ifs have always worked in ACS, and [wiki=Other_useful_functions]many of the custom functions on the wiki use it[/wiki].
I always thought randi's commit message was to teach people the difference between using braces and not, because rookie mistakes happen. I could be wrong, but still, we all start from somewhere.
Code: Select all
//Broken
if (...)
Function1
Function2 //People mistake indenting here for counting as part of the if statement, when in reality, that's not happening. 2 and 3 are being called regardless.
Function3
//Fixed
if (...)
{
Function1
Function2
Function3
}