Comment by rpcope1

Comment by rpcope1 2 days ago

21 replies

That's probably one of the more frustrating things about Python. Each release it gets all sorts of questionable new syntax (including the very strange pattern matching "feature" that kind of sucks compared to something like Erlang or Scala), but we never get real useful quality of life improvements for basic functional programming like TCO or multi line lambdas

throwaway81523 2 days ago

Python has always been unashamedly imperative, with some functional features entering by slipping through the cracks. The pattern matching thing seemed ok to me when I tried it, but I haven't used it except briefly, since I'm still mostly on Python 3.9. Interestingly, Python has been losing users to Rust. I don't entirely understand that, other than everyone saying how Rust's tooling is so much better.

  • flakes 2 days ago

    > Python has been losing users to Rust. I don't entirely understand that, other than everyone saying how Rust's tooling is so much better.

    Not to rust, but to Go and C++ for myself. The biggest motivating factor is deployment ease. It is so difficult to offer a nice client install process when large virtual environments are involved. Static executables solve so many painpoints for me in this arena. Rust would probably shine here as well.

    If its for some internal bespoke process, I do enjoy using Python. For tooling shipped to client environments, I now tend to steer clear of it.

    • sieve 2 days ago

      > For tooling shipped to client environments, I now tend to steer clear of it.

      A guy on r/WritingWithAI is building a new writing assistant tool using python and pyQt. He is not a SE by trade. Even so, the installation instructions are:

      - Install Python from the Windows app store

      - Windows + R -> cmd -> pip install ...

      - Then run python main.py

      This is fine for technical people. Not regular folks.

      For most people, these incantations to be typed as-is in a black window mean nothing and it is a terrible way of delivering a piece of software to the end-user.

    • pjmlp 2 days ago

      As someone that always kept a foot on C++ land, dispite mostly working on managed languages, I would that by C++17 (moreso now in C++23), dispite all its quirks and warts, C++ has become good enough that I can write Python like code with it.

      Maybe it is only a thing to those of us already damaged with C++, and with enough years experience using it, but there are still plenty of such folks around to matter, specially to GPU vendors, and compiler writers.

      • cempaka 2 days ago

        Are there any books or curricula you'd recommend to someone starting out, who wants to learn a more modern style? My main worry is just that everything is going to be geared to C++11 (or worse, 98).

  • mikepurvis 2 days ago

    I'm largely still a Python user, but when I've used it, rust overall gross way more thoughtfully and consistently designed— both in the core language features and in the stdlib.

    Python's thirty years of evolution really shows at this point.

  • coldtea 2 days ago

    >Python has been losing users to Rust

    Not really.

dragonwriter 2 days ago

> we never get real useful quality of life improvements for basic functional programming like TCO or multi line lambdas

A lambda can be as big of an expression as you want, including spanning multiple lines; it can't (because it is an expression) include statements, which is only different than lambdas in most functional languages in that Python actually has statements.

  • kqr 2 days ago

    > most functional languages

    Most popular functional languages I can think of except maybe Haskell has statements!

pinoy420 2 days ago

The choice of “unique” verbs is weird too. Case match. Try except?

  • maleldil 2 days ago

    `match/case` looks absolutely fine to me. What's the problem?

    `try/except` is definitely weird, though.

jgalt212 2 days ago

The utility value of multi-line lambdas is real, but the readability of these is terrible. And Python prizes readability. So you know where this initiative will end up.

  • saagarjha 2 days ago

    Nothing more readable than a triply-nested list comprehension on an object that exists only to vend its __getattr__ for some unholy DSL

    • pinoy420 2 days ago

      Annoying. Because it “compiles” to less optimal code than writing it explicitly.

  • vrighter 2 days ago

    I personally find python to be highly UNreadable, especially with all of its syntax and braindead scoping rules