• masterspace@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    Python is popular because it’s whitespace based syntax make noobs think it’s easy to read. This and it’s pre-installation on Linux made it popular amongst academics who embraced it for data analysis. This lead to a lot of data scientists embracing it and writing libraries for it which created a virtuous cycle in that arena.

    And it’s a damn shame because Python, and it’s whitespace nonsense and lack of type system, is a horribly impractical language for building anything at scale.

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      1 month ago

      It does make it easier to read. We primarily use indentation to match brackets, so clearly, indentation is the most important readability feature between the two, not brackets.

      Try reading the same piece of code: without brackets, and then without whitespaces and tell me which is better.

      Whitespaces as syntax force you to indent your code properly and not be misleading.

      • masterspace@lemmy.ca
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        1 month ago

        I literally do that professionally, and I’m telling you that brackets are inarguably better.

        You are used to whitespace; I have literally spent months refactoring and upgrading a react frontend and a python backend and am telling you that brackets are a single character and far more predictable, and then your IDE / Linter / Formatter can reliably use them to fill in the perfect indentation and whitespace.

        My first professional language was Python, but I have since tried a half dozen others and would never choose to go back to a whitespace based language unless there was a good reason.

        • Eager Eagle@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 month ago

          I’ve written C, JS, PHP, and a few others. Today I write Python almost everyday and wouldn’t trade it for any of them. Maybe Rust, but not because of brackets.

      • masterspace@lemmy.ca
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month ago

        No, it’s not. It was rewritten in Facebook’s version of PHP when they bought them.

    • flatbield@beehaw.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      Typing thing is way over blown. What did suck before Python 3 was indeterminate type result from the / operator. You never know if it would be integer or floating division looking at the code. Now it is floating.