this post was submitted on 02 Nov 2024
263 points (98.2% liked)

Python

6366 readers
3 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 24 points 1 week ago* (last edited 1 week ago) (42 children)

Thank god, Javascript is a mess.

I’ll still plug Scala for having the beauty of Python, the ecosystem of Java, the correctness of Rust, the concurrency of Go, and the power of Lisp.

[–] [email protected] 62 points 1 week ago (22 children)

I code both typescript and python professionally, and python is almost as much of a mess, just a different kind of mess. The package manager ecosystem is all over the place, nobody is agreeing on a build system, and the type system is still unable to represent fairly simple concepts when it comes to function typing. Also tons of libraries just ignore types altogether. I love it, but as a competitor to JavaScript in the messiness department it's not a good horse.

[–] [email protected] 13 points 1 week ago* (last edited 1 week ago) (5 children)

They ignore types all together because typing is optional in python.

[–] [email protected] 12 points 1 week ago (1 children)

All documentation is optional and ignored at runtime, that doesn't mean you shouldn't do it. If your library doesn't have type hints I'm just not gonna use it, I don't have the time to figure out what you accept or return.

[–] [email protected] -2 points 1 week ago (1 children)

It means they have the option to do it or not do it and you have the option to not use it, which clearly your exercising. I've personally never had a situation where a lack of type hints slowed me down even a little.

[–] [email protected] 5 points 1 week ago (1 children)

I dunno if you're being deliberately obtuse, but just in case you really did miss his point: the fact that type hints are optional (and not especially popular) means many libraries don't have them. It's much more painful to use a library without type hints because you lose all of their many benefits.

This obviously isn't a problem in languages that require static types (Go, Rust, Java, etc..) and it isn't a problem with Typescript because static types are far more popular in JavaScript/Typescript land so it's fairly rare to run into a library that doesn't have them.

And yeah you can just not use the library at all but that's just ignoring the problem.

[–] [email protected] 1 points 1 week ago (1 children)

True, but if you're looking at a Python library that doesn't have type hints in 2024, then chances are that it's not very good and/or not very well maintained.

[–] [email protected] 1 points 1 week ago

Well, indeed. Unfortunately there are still a fair number of them. The situation is definitely improving at least.

load more comments (3 replies)
load more comments (19 replies)
load more comments (38 replies)