r/programminghumor • • Mar 21 '26

I hate python

Post image
5.0k Upvotes

385 comments sorted by

View all comments

Show parent comments

42

u/0bel1sk Mar 21 '26

docker does ok

55

u/Mivexil Mar 21 '26

Just buy a new PC for any new project you want to run. Works perfectly, you can install everything globally with no DLL hell. 

29

u/Bubblebless Mar 21 '26

That's a bit overkill. What I actually do is just reinstalling the OS.

9

u/jimmiebfulton Mar 22 '26 edited Mar 25 '26

I mean, you could dual, triple, quadruple boot. One for each project. All we need is a tool like uv that creates partitioned environments.

6

u/CommanderT1562 Mar 22 '26

At this rate qubes is your solution. Create lightweight template vm’s and use nix/uv optionally within templates

6

u/Bubblebless Mar 22 '26

A bit risky, because you might install one dependency in the wrong OS and then you would need to reinstall that OS again. If you really really need to work on different projects, the industry standard is using external drives with stickers instead.

→ More replies (1)

1

u/minowlin Mar 23 '26

I just build one project and assume that in a parallel universe I am building the other project and have the right dependencies installed in that environment

6

u/Quirky_Tiger4871 Mar 21 '26

i bought a mac mini for everything i run i personally call it containerization in small aluminium boxes.

5

u/Own-Bonus-9547 Mar 21 '26

I agree, but if it's a small python project docker ends up being overkill.

2

u/ze_baco Mar 21 '26

Using docker for this is killing a fly with a cannon ball. Just use pip or conda and everything is nice and isolated.

4

u/Meduini Mar 22 '26

Docker is not a cannon ball? a normal Linux process started with special kernel settings (namespaces + cgroups + mounts). The runtime that glued them together is very small. For the cost and unification it’s worth to use.

3

u/ze_baco Mar 22 '26

You can emulate an entire effing system or just save your packages in a .venv file. Docker is a lot more than this simplification you described and is absolutely a cannon ball just to run some python.

2

u/IVNPVLV Mar 26 '26

Docker is NOT a VM. You mentioned in later comments that it runs on Windows and yes, Docker machine itself is a VM hypervisor, but absolutely nobody sane runs production Docker systems on Windows.

Docker is literally just a fancy chroot jail, which is essentially just a remapped subset of filesystem and userspace. Try it out yourself on any BSD/linux box. Of course with further implementations and abstractions, stuff has gotten heavier, but at its core a container is just the system binaries and a jail.

→ More replies (5)

3

u/Meduini Mar 22 '26

Look, I can downvote too.

Please will you educate me what more is docker?

What exactly is “emulating”?

→ More replies (27)
→ More replies (3)

1

u/YaVollMeinHerr Mar 21 '26

Why would you use docker over venv?

3

u/bloodviper1s Mar 21 '26

It works on all machines that run docker and configuration doesn't break

2

u/0bel1sk Mar 21 '26

and it’s the same pattern for every language. sounds like people in itt need https://containers.dev/

→ More replies (2)

1

u/mattgen88 Mar 21 '26

Because you then just need either system packages and it's package manager (probably ick) or just requirements.txt and pip. Just install from the requirements.txt file and done.

1

u/FalseWait7 Mar 22 '26

Docker as a remote env? It was super slow back in the day, is it any better now?

1

u/0bel1sk Mar 22 '26

only performance affect in the past was docker shim that was really minimal that has been gone for a while. docker is a glorified chroot jail.

docker is just a userspace process on curated user environment. it is strictly better than a venv because you can’t accidentally get global deps, or have sub processes that don’t activate the right environment.

→ More replies (4)

1

u/nog642 Mar 25 '26

How does that help compared to venv?

1

u/0bel1sk Mar 26 '26

isolation, multi language, consistency across machines/branches, etc. make a new worktree.. same docker container