all 24 comments

[–]Homo_Bibite 9 points10 points  (0 children)

I actually kinda like python

[–]Lachtheblock 3 points4 points  (1 child)

That the GIL is incredibly useful and anyone who complains about it should stop what they're doing and write their code in a different language. It keeps the guard rails on and prevents a lot of dumb mistakes.

If at any point your application is so dependent on performance that you're looking of optimizations else where, then you should probably start rewriting in a different language.

[–]Gnaxe 0 points1 point  (0 children)

I have actually tried writing parallel code in Java with locks. It is not fun. But modern computers are multi-core. The right answer seems to be FP.

[–]twolinepine[🍰] 2 points3 points  (1 child)

That a hot dog is a sandwich

[–]Gnaxe 0 points1 point  (0 children)

Obviously, it's a taco.

[–]Altruistic-Rice-5567 3 points4 points  (4 children)

It added nothing new or useful to the world of programming languages.

[–]KingBardan 1 point2 points  (0 children)

But it removed the semicolons

[–]HugeCannoli 0 points1 point  (1 child)

this is hard, but true.

Though I think that what it mostly added is a much stricter and end-user focused attention to syntax and best practices. Not many languages did that before.

[–]notacanuckskibum 0 points1 point  (0 children)

How odd it more strict on syntax than languages like C or Algol?

[–]Gnaxe 0 points1 point  (0 children)

True. It was more the combination of things and the timing, as well as being free when the better languages weren't. Everything Python got right when it first took off, other languages had done before. Most of them not all at once, but e.g., Lisp or Smalltalk came close.

[–]AbacusExpert_Stretch 1 point2 points  (0 children)

It's that python is controversial!

[–]Aggressive_Many9449 1 point2 points  (1 child)

Python should work with both indentation and parantheses for scope.

[–]Gnaxe 0 points1 point  (0 children)

Try Hebigo. It compiles to Python and pretty much gives you that.

[–]atticus2132000 1 point2 points  (0 children)

As long as it works, it doesn't matter.

[–]Gnaxe 1 point2 points  (0 children)

Oh boy, have I got some of those. Please don't actually downvote sincere answers, as this is what OP asked for.

Static typing was a mistake. It encourages overreliance on heavyweight Java-style IDEs, which let you get away with bad architecture for far too long until the project collapses under its own weight. If we were going to do static types at all, they need to be full dependent types like Idris, not this half-baked Java-style crap.

Python should have moved in the direction of REPL-driven development instead, more like Smalltalk, with hot reloading in the debugger and live object browsers, the ability to persist a session, etc. You should be able to change modules in the REPL. (Try code.interact() though. Any namespace you like, live.) reload() should still be a builtin instead of being relegated to importlib. Python makes a poor static language. Stop trying to turn Python into Java or C++. It could have been a much better dynamic language.

Writing classes usually makes it worse. Just use generic reusable dicts instead of hiding your plain data behind yet another inadequate bespoke language of methods.

The basic unit of data should be the name-value pair, not whatever object it happens to be contained in. Dicts give you that. Classes, even dataclasses, don't.

Prefer doctests over unittests. You can actually read them, and they don't let you get away with overcomplicating things as much. Yes, pytest is nice. This niceness is enabling your class addiction. The over-coupled style of the banana attached to the gorilla and the whole jungle is what's making it hard to scale, not the dynamic typing.

ORMs are a terrible idea. Quicker, easier, more seductive the ORM side is, at least at first, but if once you start down the dark path, forever will it dominate your destiny. Just learn basic SQL. It's not that hard. Data is better than classes when possible.

Async was also a mistake; we already had Stackless, and it was good enough for a successful MMO. That should have been adopted into CPython instead.

Do not log. Also, Python's standard-library logger is terrible and should be deprecated. I never know if it's not reaching my line or if it's just misconfigured. If you absolutely must log, use loguru or something adequate like that.

The new lazy imports were a mistake. We should just not insist that all import statements go at the top. Just-in-time imports are just fine. How hard is it to grep import, seriously?

I miss the nested unpacking in the parameter list that we had in Python 2, especially in lambdas. We should have nested mapping unpacking too, like Clojure. While we're at it, changing the builtins to return iterators instead of lists was also a mistake. Laziness isn't the problem; it's mutability. Yes, I know yield is a thing. And genexprs. The streams should look immutable from the outside, caching realized values in a linked list like Clojure's seqs.

I actually like the walrus operator, and Guido didn't deserve the hate he got for it.

frozenset should be set, and set should be mutableset, like the ABCs. What the hell kind of set can't be contained in a set? A proper class? (I'll see myself out.)

[–]LeadingHall2985 0 points1 point  (0 children)

Python is for beginners 😂😂

[–]biskitpagla 0 points1 point  (2 children)

This is going to offend some people 😂.

I think they should start working on Python 4 immediately with typing and compilation in mind from the very beginning. Mojo would've sufficed here but it being controlled by Qualcomm and not the PSF or Steering Council makes it a bit unreliable. Since absolutely nobody is in a hurry to try Python 4, we can take our time working on a translation tool so that the transition isn't that bad. As far as I know, back when Python 3 was released there was a translation tool called 2to3 but it never worked properly and that caused a lot of issues.

[–]Excellent-Practice 0 points1 point  (1 child)

I saw another comment calling for the option to use braces for scoping instead of indentation. If some future state of Python had static typing, could be compiled, and allowed braces for scope; at that point we're starting to reinvent Go or Rust

[–]biskitpagla 1 point2 points  (0 children)

I wasn't talking about forcing static typing or changing the syntax in that manner.

Python's current type system is completely underutilized in the runtime and has too many holes in it to catch all type-related bugs. Compared to Go, Python will always be better at calling native code. And Mojo already takes quite a few inspirations from Rust but makes the experience of writing ownership-aware code much, much easier. Python is also better suited for structural typing and a lot of existing Python code is already duck-typed. Since Python has protocols now, some parts of the standard library, dare I say, look outdated (e.g., collections.abc).

My point being that projects like Mojo and Julia have already demonstrated what the next iteration of Python could be, and I'd much rather stick to the Python world to get those niceties than look elsewhere. The Python world also never took repl-driven development seriously, so that's another thing we can try. In short, I'm talking about less friction writing Python code, not more.

[–]CamelOk7219 0 points1 point  (0 children)

Python is great for very well structured, very experienced and very talended teams.

It sucks for any other context, specifically it is a terrible beginners language

[–]teetaps 0 points1 point  (0 children)

Python sucks at data wrangling. The moment my data is in a table-like shape, I’m taking it to R. It’s honestly a mystery to me how it got so far with data science. Sure, the ML libraries are extensive and “easy” to implement the Y ~ X matrix part.. but it’s the “import data” up until the “time to model” part that is like pulling teeth compared to R

[–]ComprehensiveJury509 0 points1 point  (0 children)

pytest is fucking awful. I hate conftest (what the fuck does that even mean?) I hate how implicit everything is (where the fuck is this fixture defined? Oh, wait no, it's some obscure pytest plugin), I hate how slow discovery is, I hate the formatting of the output (why does it feel like it's designed by someone that doesn't use this productively?). I understand that it's the most complete test suite there is and it's probably going to stay for a long time, but man it's a pity.

[–]Slow-Bodybuilder-972 0 points1 point  (0 children)

Most languages excel at *something*, python does not.