I think this is more like a rant.

Holy Christ! I’ve been using Python to do some simple scripts here and there, and what a terrible language to deal with (yea, terrible, just down vote and move on, I need to say it somewhere).

Why would anyone change so many standards? I often need to deal with PHP/JS at the same time and I don’t have a single issue, they feel like the same language in practice, but when it comes to Python everything changes.

I just hate this more human-readable philosophy of Python, we need a common ground to communicate with the machine, I don’t want fancy keywords or syntax, it’s not that hard to learn a new syntax, it might take a few days, it’s not worth the trade off of changing so many standards that older languages came with.

For some reason every single code I write feels aesthetically ugly. I feel like the letters are just floating around without brackets and curly brackets.

I often mistake a lot of:

for x in list:

With:

for (x in list):

And it’s done, syntax error, I need to go back and do it “Python way”. It’s way harder to read Python code than anything else, I want to read what the for loop expression is evaluating, and the lack of brackets make it harder to assimilate.

Don’t even let me talk about types! Why would you provide a way to type parameters but don’t enforce it at runtime? Jesus Christ! It could be simple: if you type a parameter, you want it to be checked, if not, you wouldn’t type anything. You need to import built in types, why would any human on Earth make a decision like that? (from typing import List, Optional)

Why so many different ways to declare an array-like structure? Tuples, Sets, Dicts, Lists? Dude… ffs, I know each one supposedly has a “different” purpose, I literally don’t see any good benefits on it. It just makes me more confuse.

I’m not talking about 3rd party libraries like mypy, I’m talking about things that should be on language core since the first version.

The more I learn about Python, more it pisses me off. I’m mainly using it because of interoperability, easy to setup, it runs flawlessly in any OS and Python usually comes pre-installed in many OSs, but the experience of developing in this language is just terrible.

  • BatmanAoD@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    I don’t necessarily love Python either, but it sounds like your perspective is a little limited.

    Why would anyone change so many standards?

    You happen to have almost exclusively used languages that are syntactically descended from a common ancestor, Algol. If you had learned a LISP descendant, or another non-Algol language such as ML, Prolog, APL, or Haskell, you’d probably be less surprised by Python not following the Algol-ish syntax.

    Why would you provide a way to type parameters but don’t enforce it at runtime?

    As another commenter mentioned, this is basically just a result of Python’s historical development. Explicit types are fully optional, and originally did not exist: the type annotations idea wasn’t even created until 2014, over two decades (!!) after Python’s initial release; and that was just the initial theoretical groundwork, not an implementation of anything. To introduce explicit static typing into a language that is dynamically or implicitly typed, without breaking legacy code, requires gradual typing, an idea that is relatively recent in the history of programming languages, and there are different approaches. The TypeScript approach may seem like the obvious “right” way now that TypeScript has become so dominant in the JS ecosystem, but it was in no way obvious that TypeScript would be so successful back when it was introduced, which was right around when Python started developing its gradually-typed system. So Python took a different approach: rather than designing a new language as a superset of the existing language, and writing a compiler to typecheck the new language and strip type annotations, they added a syntax for type annotations into the language, so that the code you write is still the code that actually gets interpreted, but decided that actually enforcing type-checking should be left to separate tools rather than the Python interpreter. Personally, with the benefit of hindsight, and as someone who has not used Python much and prefers Rust-style static typing, I think the TypeScript way is better. But I don’t think Python is likely to evolve in that direction.