• Bobo The Great@sopuli.xyz
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    18 days ago

    Partially unrelated to the meme, but I find it almost malicious how some python keywords are named differently from the nearly universal counterpart of other languagues.

    This/self, continue/pass, catch/except and they couldn’t find a different word for switch so they just didn’t implement it.

    It’s as if the original designers purposefully wanted to be different for the sake of it.

  • schnurrito@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    19 days ago

    TBF the last two bullet points are verbose descriptions of the thing it means in C++, Java, and Python too. It’s just that in JS, “this” can also be used in other places.

    But yeah, in practice, every time I write JS I want to throw my hands in the air and shout “this is bullshit”, but never know what “this” refers to… :D

  • WolfLink@sh.itjust.works
    link
    fedilink
    arrow-up
    1
    ·
    19 days ago

    In Python, self is not a keyword, it’s a conventional variable name. You can replace all instances of “self” with “this” and your code will work the same.