• namingthingsiseasy@programming.devOP
    link
    fedilink
    arrow-up
    16
    arrow-down
    1
    ·
    1 month ago

    My opinion: Python may not be the best at everything it does, but it’s in the top 3-5 languages in the following areas:

    • Very easy to install, write and understand
    • Great libraries for a lot of applications
    • Large community, lots of people with experience in it

    It will always be a practical choice for those reasons. There are probably a lot more as well that I can’t think of at the moment.

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    7
    arrow-down
    2
    ·
    1 month ago

    I think it’s just because it is always recommended as an “easy” language that’s good for beginners.

    The only other thing it has going for it is that it has a REPL (and even that was shit until very recently), which I think is why it became popular for research.

    It doesn’t have anything else going for it really.

    • It’s extraordinarily slow
    • The static type hints are pretty decent if you use Pyright but good luck convincing the average Python dev to do that.
    • The tooling is awful. uv is a lifesaver there but even with uv it’s a bit of a mess.
    • The package system is a mess. Most people just want to import files using a relative path, but that’s pretty much impossible without horrible hacks.
    • The official documentation is surprisingly awful.
    • Implicit variable declaration is a stupid footguns.

    The actual syntax is not too bad really, but everything around it is.

    • Vulwsztyn@programming.dev
      cake
      link
      fedilink
      arrow-up
      1
      ·
      1 month ago

      syntax is bad for list operations, also there are situations where you need to count the number of parentheses you closed, which wouldn’t happen of you were able to use fluent interfaces

    • namingthingsiseasy@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      1 month ago

      I think it’s just because it is always recommended as an “easy” language that’s good for beginners.

      The only other thing it has going for it is that it has a REPL (and even that was shit until very recently), which I think is why it became popular for research.

      If that’s the case, then why didn’t Javascript take its place instead? It’s arguably even better at Python in both of those areas…

      • FizzyOrange@programming.dev
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        1 month ago

        I think Python is superficially easier since you don’t have to declare variables, printing is a little easier, etc. And in some ways it is actually easier, e.g. arbitrary precision integers, no undefined, less implicit type coercion.

        But I agree JavaScript is generally a better choice. And it is actually more popular than Python so…

  • Reptorian@programming.dev
    link
    fedilink
    arrow-up
    4
    ·
    1 month ago

    I’d say libraries is why it is popular. Also, I’m not a Python developer, and I don’t bother with libraries.

  • flatbield@beehaw.org
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    edit-2
    1 month ago

    Presumably because it minimizes developer time in writing code and is easy to use and it come with great libraries. That is why I have been using it since 1998.

    Edit: People use to think I was crazy using Python. It was interesting seeing people slowly get a clue over the years.

  • sobchak@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    1 month ago

    I started using it as an alternative to Octave/Matlab and Perl. Python is better at general programming than Octave/Matlab, and better syntax than Perl (IMO) while being almost as easy to do the same stuff I was using Perl for. It’s very good for quickly writing small scripts. Issues can arise on large projects/teams because of stuff like type safety, and it also has issues with performance.