After getting back into Python, I'm starting to notice and be annoyed more and more by my C# coding style requiring braces everywhere
if (...)
{
return ...;
}
else
{
return ...;
}
preferring the (subjective) much cleaner looking python counter-part
if ...:
return ...
else
return ...
is there any way I can go about hiding these braces (as they do take up about 30% of my coding screen on average and just look ugly!)
Sorry, but if you're coding in C# and doing more than just simple single-expression blocks, you're going to have to suck it up. Python's "indent-denotes-scope" grammar may be nice, but it's Python, not C#.
You could switch to:
if (...) {
return ...;
} else {
return ...;
}
to gain some screen.
I think it's a bad idea to pretend that C# works like Python though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With