I was just reading an SO question on Python, and noticed the lack of parentheses in a for-loop. Looked nice to me, then I wondered: why does C# require them?
For example, I currently need to write:
if (thing == stuff) {
}
and
foreach (var beyonce in allthesingleladies) {
}
So I am wondering why I can't write:
if thing == stuff {
}
Is there a syntactic ambiguity in that statement that I am unaware of?
PS, funnily, braces can be optional for one-liners:
if (thing == stuff)
dostuff();