Also, do y’all call main() in the if block or do you just put the code you want to run in the if block?

  • itslilith@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    6
    ·
    3 days ago

    that is so cursed

    And I say that as someone who learnt python as her first language (to be proficient in):

    holy shit is this language stupid

    • Fushuan [he/him]@lemm.ee
      link
      fedilink
      arrow-up
      11
      ·
      edit-2
      3 days ago

      I’m gonna repeat what I wrote in another comment. You are comparing the default interpreted way of running pythong to a compiled language. When you compile a python program into a wheel, you define the entry points of the code on it, and they point to functions like main() or whatever you define.

      You aren’t complaining that a index.js doesn’t automatically run the main function when run by node, or that bash doesn’t also have a default main function execution. Interpreted languages oriented to scripting won’t have the same rules as compiled languages.

      programming languages aren’t usually cursed, what’s cursed is the way some people decide to structure their programs. I’ve seen some stuff.

      • hdnsmbt@lemmy.world
        link
        fedilink
        arrow-up
        6
        ·
        3 days ago

        pythong

        Glad to see I’m not the only one who can’t type python without Sigmund waving hello.

        • Fushuan [he/him]@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          3 days ago

          It’s my fucking keyboard. I’m all in for open source and stuff but it’s too much, I had to go back to proprietary ones because the other ones just suck for multi language inputs :(

      • itslilith@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        3
        ·
        3 days ago

        Some programming languages are indeed cursed (e.g. JavaScript). But for the most part I agree, it’s what people do with it. But what’s cursed with python is what idioms have become common place.