The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
I would say that such highly hypothetical code has nothing to do with nothing...
I also would say that you do not know how to write efficient code in C#, if you think you have to add all those brackets, or that this is the only way to write it...
You also totally drop the factor of experience... C# can be done in different ways, and be still perfectly readable for the experienced...
It appears with the garbage VB and supposedly identical C# you concocted that you are a master of master of all things! We should bow to you and our soon-to-be VB.NET overlords!
Oh, but wait, what's this? Surely this doesn't work?! You can't have expressions in a C# switch statement!!!
Sorry, but YES YOU CAN, if you know even 1% of C# BASIC syntax...
caseint xx when xx <50 || xx == 42:
for (int x = 0; x <101; x++)
for (int y = 0; y <101; y++)
for (int z = 0; y <101; z++)
L1 = DoSomethingWithL(x, y, z, L1);
L1 = (L1 == 2 ? L1 = 3 : L1 = 0);
caseint xx when xx >390:
L1 = 0;
L1 = 32;
If you love VB.NET, then USE it, we don't care. Just stop embarrassing yourself by trying to "Prove" how much better VB.NET is.
I am proficient in both languages and I prefer C#. That doesn't make me better or worse than you.
All you do with these threads on "VB is better!!!" is tick people off. If that's how you get your jollies, I feel for you.
1000x times yes. Oh goodness, I'm spending lines, LINES on syntax that explicitly marks the beginning and end of each statement. OH NO, STOP THE PRESSSES, CANCEL C#, READABILITY IS OVERRATED, all bow to the mighty "more lines on screen = good" crowd.
That is true only because MS deemed it so. They have less support for VB, the business language that built MS. It is a quality language as is c# only with out the } and is intelligent enough to know when the statement ends unlike is single letter counterpart.