this post was submitted on 16 Sep 2024
722 points (97.4% liked)

Programmer Humor

32596 readers
621 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
[–] [email protected] 6 points 2 months 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.

[–] [email protected] 5 points 2 months 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...

[–] [email protected] 2 points 2 months ago

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

[–] [email protected] 1 points 2 months 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?

[–] [email protected] 1 points 2 months 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.

[–] [email protected] 1 points 2 months ago* (last edited 2 months 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

[–] [email protected] 4 points 2 months ago (2 children)

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

[–] [email protected] 5 points 2 months ago

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

[–] [email protected] 2 points 2 months 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.

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

Agreed, numpy really could/should be built in.

[–] [email protected] 2 points 2 months ago (2 children)

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

-Data Nerd

[–] [email protected] 2 points 2 months ago

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

[–] [email protected] 1 points 2 months ago

The standard library is where project go to die.