this post was submitted on 16 Sep 2024
718 points (96.7% liked)

Programmer Humor

32415 readers
610 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] DerArzt@lemmy.world 6 points 1 month ago (2 children)

For how popular of a language python is, at this point it's a bad sign to me that the language has default way to manage versions and create new projects. I get having options, but options are annoying to new folk.

[–] Ephera@lemmy.ml 5 points 1 month ago (2 children)

Honestly also annoying as a not-so-new folk. I just thought about this yesterday, I reasonably expect to clone a random project from the internet written Java, Rust et al, and to be able to open it in my IDE and look at it.

Meanwhile, a Python project from two years ago that I helped to build, I do not expect to be able to reasonably view in an IDE at all. I remember, we gave up trying to fix all the supposedly missing dependencies at some point...

[–] AkatsukiLevi@lemmy.world 2 points 1 month ago

If the language can just break during runtime because of code indentation, I can't really trust it

[–] psud@aussie.zone 1 points 1 month ago (1 children)

Does python not require you to include your libraries? How can the runtime environment not tell you "you used whatever library but whatever library isn't installed" is it then hard to find the library? Does python not have anything like perl's cpan to consolidate all libraries? Can't you just grep for the libraries a project calls and loop over the results adding that library to the build environment?

[–] Ephera@lemmy.ml 1 points 1 month ago (1 children)

It does have that, the ecosystem is just really fractured and also not good.

Sort of the 'standard' way of managing dependencies is with Pip and a requirements.txt. By itself, that installs dependencies on your host system.
So, there's a second tool, venv, to install them per-project, but because it's a separate tool, it has to do some wacky things, namely it uses separate pip and python executables, which you have to specify in your IDE.
But then Pip also can't build distributions, there's a separate tool for that, setup.py, and it doesn't support things like .lock-files for reproducible builds, and if I remember correctly, it doesn't deal well with conflicting version requirements and probably various other things.

Either way, people started building a grand unified package manager to cover all these use-cases. Well, multiple people did so, separately. So, now you've got, among others:

  • Pipenv
  • Pip-tools
  • Conda
  • PDM
  • Poetry
  • Rye

Well, and these started creating their own methods of specifying dependencies and I believe, some of them still need to be called like a venv, but others not, so that means IDEs struggle to support all these.

Amazingly, apart from Rye, which didn't exist back when we started that project, none of these package managers support directly depending on libraries within the same repo. You always have to tag a new version, publish it, and then you can fix your dependent code.

And yeah, that was then the other reason why this stuff didn't work for us. We spent a considerable amount of time with symlinks and custom scripts to try to make that work.
I'm willing to believe that we fucked things up when doing that, but what makes still no sense is that everything worked when running tests from the CLI, but the IDE showed nothing but red text.

[–] psud@aussie.zone 1 points 1 month ago* (last edited 1 month ago)

So it's big and diverse ecosystem with multiple standards to choose between

The problem isn't that it's missing something like cpan, it's that there are ten incompatible ones to choose between

Remind me not to learn python. If I get into microcontrollers I shall use their C++ like language not micropython ;)

I really like the ability to dig up code from twenty years ago and just run it

[–] pennomi@lemmy.world 4 points 1 month ago (2 children)

Why would it be a bad sign that the language has built in tools for common things you need to do?

[–] Ephera@lemmy.ml 5 points 1 month ago

I'm guessing, they meant to write "that the language has no default way".

[–] driving_crooner@lemmy.eco.br 2 points 1 month ago (1 children)

One of the things that frustrated me more with python, coming from R and Julia, was that the math and statistics functions weren't default. But after learning more, and learning the math, numpy, scipy and others started yo like that, there's different projects working on the same and you pick and choose what works better for you.

[–] pennomi@lemmy.world 1 points 1 month ago (1 children)

Agreed, numpy really could/should be built in.

[–] xpinchx@lemmy.world 2 points 1 month ago (2 children)

Also pandas and matplotlib but maybe that's just me.

-Data Nerd

[–] driving_crooner@lemmy.eco.br 2 points 1 month ago

But what about the pleasure of starting any project with "import pandas as pd"?

[–] wewbull@feddit.uk 1 points 1 month ago

The standard library is where project go to die.