this post was submitted on 02 Nov 2024
260 points (98.1% liked)

Python

6337 readers
36 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
[–] aubeynarf@lemmynsfw.com 24 points 4 days ago* (last edited 4 days 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.

[–] FizzyOrange@programming.dev 5 points 4 days ago (14 children)

Typescript is far nicer than Python though. Well I will give Python one point: arbitrary precision integers was absolutely the right decision. Dealing with u64s in Typescript is a right pain.

But apart from that it's difficult to see a single point on which Python is clearly better than Typescript:

  • Static typing. Pyright is great but it's entirely optional and rarely used. Typescript obviously wins here.
  • Tooling. Deno is fantastic but even if we regress to Node/NPM it's still a million miles better than the absolute dog shit pile of vomit that is Pip & venv. Sorry Python but admit your flaws. uv is a shining beacon of light here but I have little hope that the upstream Python devs will recognise that they need to immediately ditch pip in favour of officially endorsing uv. No. They'll keep it on the sidelines until the uv devs run out of hope and money and give up.
  • Performance. Well I don't need to say more.
  • Language sanity. They're pretty on par here I think - both so-so. JavaScript has big warts (the whole prototype system was clearly a dumb idea) but you can easily avoid them, especially with ESLint. But Python has equally but warts that Pylint will tell you about, e.g. having to tediously specify the encoding for every file access.
  • Libraries & ecosystem. Again I would say there's no much in it. You'd obviously be insane to use Python for anything web related (unless it's for Django which is admittedly decent). On the other hand Python clearly dominates in AI, at least if you don't care about actually deploying anything.
[–] namingthingsiseasy@programming.dev 3 points 3 days ago* (last edited 3 days ago) (6 children)

What is so bad about virtual environments? I found them to be really nice and useful when I developed in Python over about 5-ish years. It was really nice being able to have separate clean environments for installing libraries and executing things.

Granted, I only used Python as a solo developer, so if there are shortcomings that emerge when working with other developers, then I would not be aware of them....

Edit: also, performance is a bit more of a subtle topic. For numerical logic, Python actually is (probably) much better than a lot of its competitors thanks to numpy and numexpr. For conditional logic, I would agree that it's not the best, but when you consider developer velocity, it's a clearly worthwhile tradeoff since frameworks like Django are so popular.

[–] vithigar@lemmy.ca 5 points 3 days ago (1 children)

What is so bad about virtual environments?

They're a solution to a self-inflicted problem. They're only "really nice and useful" if you accept that having your projects stomp all over each others' libraries and environments is normal.

If projects were self-contained from the outset then you wouldn't need an additional tool to make them so.

[–] eager_eagle@lemmy.world 1 points 2 days ago

thankfully Python seems to be moving away from the "activating your venv" nonsense. If you use poetry or uv, you don't necessarily need to "activate" it before running your code; though a lot of people still try to do it because of learning inertia I guess.

load more comments (4 replies)
load more comments (11 replies)
load more comments (38 replies)