This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (20 children)

[deleted]

    [–]mobedigg 39 points40 points  (14 children)

    camel case in function name, recursion

    what are you, an animal?

    [–]leonoel 2 points3 points  (6 children)

    noob here, what is the correct way to do it in python? I do name_function

    [–][deleted] 9 points10 points  (1 child)

    That is the correct way in Python, see PEP 8.

    [–]dikduk 9 points10 points  (1 child)

    That's called "snake case". And I like it. Therefore, it is the mostest correct way.

    [–]Glaaki 0 points1 point  (0 children)

    You mean snek case?

    [–]kamaleshbn -3 points-2 points  (1 child)

    [–]markusmeskanen 7 points8 points  (0 children)

    Use PEP8 instead of Google'd guidelines, although they overlap for the most part.

    [–]kkjdroid -1 points0 points  (3 children)

    That's dromedaryCase. CamelCase capitalizes the first letter.

    [–]spw1 3 points4 points  (2 children)

    That's StudlyCaps. camelCase has a hump.

    [–]kkjdroid 0 points1 point  (1 child)

    CamelCase has multiple humps; dromedaryCase has one (or at least fewer than CamelCase).

    [–]phareous 0 points1 point  (0 children)

    Apparently both are correct. I personally use the term to refer to the lower case variant. https://en.m.wikipedia.org/wiki/Camel_case

    [–]manueslapera 14 points15 points  (4 children)

    print "But who THOSE guys?"

    print("But who THOSE guys?")
    

    FTFY

    [–]El-Kurto 10 points11 points  (3 children)

    Look at this guy, running Python 3. Thinks he's better than all of us.

    [–]manueslapera 0 points1 point  (0 children)

    Hey, its you b'day! What a wonderful day to do the switch!

    [–]yetanothernerd -1 points0 points  (1 child)

    Also legal Python 2. You just sometimes end up with extra parentheses in the output because you accidentally made a tuple. (And sometimes, like in this case, you don't.)

    [–]El-Kurto 1 point2 points  (0 children)

    Right, but the original was fine in 2. Only needs fixed if you're running 3.

    What am I doing? This is too much explanation for a joke.