Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What really grinds my gears.

Name: Anonymous 2011-10-16 22:47

If I do this with C#:

switch(foo) {
    case 0:
    case 1:
}


Visual studio gives me an error because some idiot decided that in C# it won't let you fall through to the next case label anymore.

But if I do this:

switch(foo) {
    case 0:
        int bar = 3;
        break;
    case 1:
        int bar = 4;
        break;
}


It gives me an error about redefining my variable, EVEN THOUGH YOU'VE FORCED ME TO MAKE EVERY "case" CLAUSE A COMPLETELY SEPARATE ENTITY.

Name: Anonymous 2011-10-17 6:40

You are not yet an EXPERT PROGRAMMER. If you want to achieve satori, you can do this:


int bar = 0;
switch (foo) {
    case 0: bar = 3; goto case 1;
    case 1: Bar();
        break;
    case 2: bar = 4; Baz(); break;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List