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-18 11:12

What really grinds my gears: Someone who would actually learn C# in the first place, then take the time to make forum posts about what a bad language it is.

Name: Anonymous 2011-10-18 15:06

use python and a dictionary full of lambdas, ``faggot''

Name: Anonymous 2011-10-18 15:21

>>42
lambda considered unpythonic!!

Name: Anonymous 2011-10-18 16:04

>>42, 43
how about the much more elegant method:

def case_a():
    pass

def case_b():
    pass

def case_c():
    pass

def default():
    pass

mycase = 1

print { 0: case_a, 1: case_b, 2: case_c }.get(1, default)

Name: Anonymous 2011-10-18 17:58

>>44
That was pythonic.

Name: Anonymous 2011-10-18 21:06


if case == 0:
    pass
elif case == 1:
    pass
elif case == 2:
    pass
else:
    pass


Less typing, less namespace pollution. Derp.

Name: Anonymous 2011-10-18 23:05

>>46
enjoy your O(n) ``faggot switch statement'', ``faggot''

Name: Anonymous 2011-10-19 12:47

PyBump

Name: Anonymous 2011-10-19 14:15

>>46
elif
elif
elif
elif

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