I know it's difficult since we have jobs, but Java bros, it's time to fight back
uv ftw
Is there an official doc for how to structure projects using UV?
A while ago I tried and the lack of structure and proper documentation was quite disturbing.
unsure what exactly you are looking for there, especially in comparison to pip
For example: what should I use? - requirements.txt - pyproject.toml - uv lock file
pyproject toml, lock file is generated. No need for requirements.txt
when in a project just do uv init. it generates a starting point. add dependencies with uv add, apply them with uv sync
[deleted]
Just in case what...? uv
works.
Good luck using uv with pytorch and dependencies that depend on torch, spoiler: it's not fun.
But to be fair, that's not uv fault as it's also a nightmare with poetry or any other standard package manager/resolver. It's an issue of python's dependency resolution when it comes to GPUs
[deleted]
Run uv pip freeze
.
Or look at pyproject.toml
, which is the file you should be interacting with in the first place.
pyproject.toml >> requirements.txt
Never used UV, how is it better than pip?
way more solid and super fast dependency resolution. I was reluctant to switch for a hot minute but not looking back.
While it's great, it has the same issue where it can't resolve package versions if your packages didn't specify their dependencies correctly.
tells you right away if two packages have conflicting dependencies and tells you, in seconds, its great.
I was gonna say. Uv for hobby, poetry for work. Biggest issue is installing poetry honestly.
And it's slower. And doesn't take care of python version. Why would you use an inferior tool for work? Given the choice I always go for uv in new projects.
Divided by languages, united by "Chat, please fix"
Until it deletes the db because vibe coding bad
Sure!, here's the revised code without the changes you told me to exclude!
Includes the changes I told it to exclude
When you said "Chat, please fix" it made me think of a programmer streaming on twitch, asking viewers for help.
Same lol
You don’t blame the screwdriver for being a bad hammer if you fail to understand how to use the tool correctly.
✍️✍️✍️🔥🔥🔥
If a screwdriver required as much shenanigans to screw something as Python does to use it, I would happily screw things with a hammer instead.
Java is so boilerplate and outdated
First appearence dates:
🤔
Python started with Python 3 in 2008, the other versions are... something else
Python 2 was fine for its time and purpose, but I wasn't a fan of it. Python 3 though, especially more recent versions, that's the good stuff.
I can also make java newer by arbitrarily choosing a later version of the language as the starting point.
Choose any starting point, you can't make Java seem modern
Spoken like someone who's only knowledge on java is seeing some code example based on java8 and formed his entire opinion on the language on it.
I think the controversy should end at this point
Fair enough, but I've never seen someone using anything other than python 3, Java 8 on the other hand..
Just shows how good it is 😎
Not a Java dev, so could be wrong, but isn't Java known for its 12 page long error traces? Sounds a bit like the pot calling the kettle black.
Yep. But the error is stated right at the top, with the exact exception (if it is) which makes it easier to catch it in a try and catch statement
The "long errors" don't make sense because no one is gonna tell you to scroll down and read it all. The exception, why it occured, and the line number are all at the top in most cases.
The long errors do get annoying when you get multiple exceptions at the same time, which means that you're doing something very wrong to get multiple exceptions at the same time
And with Python you get the same thing (exact exception, etc.) at the bottom of the trace, you know, the part you see on your terminal screen while the top of the stack trace is somewhere up there you need to scroll to.
This. Plus, you get an exact highlight of the source line that causes the exception. Honestly, this sounds more and more like a python W.
Does that even happen nowadays? Seems like a 2010's thing
Happened to me last week. Depends what stuff you try to use.
Not that java is actually any better. "Write once, debug everywhere", as we used to say.
Ironically JavaScript is becoming the "write once run everywhere"
Until the build breaks for no reason.
It works on my local host tho
works_on_my_machine.png
[deleted]
People love to hate on Maven/gradle because it's slightly more difficult, only to realise it works way better than pip and npm. If "difficult to use = bad" then rust would've been hated, contrary to its current state
You're the one that gets broken, but i was talking about JS churn.
the biggest issue I have is when a package is in pip, figuring out what it's called in conda (if it exists).
What do you use conda for nowadays?
data science. I'm using prebuilt base containers and that's what it uses.
strongly recommend shifting off of conda or just using it to install a better dependency manager. Was nothing but trouble for our DS team until the SWE team showed them the light of UV
uv my beloved.
Heard, friend. That's the beauty of containers is the moment it doesn't work I can throw it away! Using NVidia's containers. adding whatever we need in top has been easy enough.
I am curious what specific horror stories people have. I'm seeing the horor but deeply curious about the details
I use conda at work because IT's security settings break venv and uv...
Not if you’re using UV or Poetry. PiP is useless but there are legitimately good tools which make this a non issue.
It does because pip is still a terrible package manager. And the fact that it installs globally if you forget to activate virtual env is still a problem. Nothing 2010 about it
Happened to me last week at work when I tried using tflite and some libraries and got mismatching numpy versions, spent a big while trying to fix it before giving up and taking an alternate route
just use uv, its a godsend
We had to run it on a debian-dockerised container inside of a Toradex controller. We had limited options
I spent literally entire weeks just last year on untangling a dependency nightmare caused by some random ass cryptography library, some openssl libraries, and some conflicts way upstream of those
Python is actually incredible if you are dealing with maintained packages from good contributers and companies.
Java on the other hand, I have used some really old and outdated swing libraries that were last updated a decade ago and they still worked with my app. I was amazed
It does, i'm a third year CS student and 99% of the exceptions I get are because I wrote "import thing" instead of "import .thing" or some stuff like this.
idk about venvs though, for now I only used one specific version per PC I worked on, and i use my classmates/coworkers as beta testers to see if it works on other peoples machines. sooner or later i'll do things more cleanly, but for now it's worked okay.
I have never had any issues with just pip and no one i know has had any issues with pip.
That's good to hear, pip does work in some general scenarios but the moment you use some non-mainstream library you really need, it starts to break down. At least for me, and my colleagues at work
Use uv
Strawman. None of this is real in Python if you just use a venv...
I don't mind Java, BTW.
Sometimes you dont have the luxury of using a virtual environment. Sometimes you are stuck on whatever version of python is available and whatever environment the system has access to (eg Kodi Vs xmltree = 😞)
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Yeah it’s a real struggle
Check out uv.
uv init
uv add package
uv run main.py
Either way, idk how ppl are having package management issues with Python these days.
I'm almost positive it's people who don't use venv and then get mad that they can't get the older versions of packages in their live system due to version requirements of other packages.
Venv is a lifesaver. And I think JS folks are just too used to npm defaulting to the current directory without the -g global. Whereas pip defaults to global.
I use both js and python in my work a lot. And I've watched the people on both sides complain about the package management of the other side. Lol. But the truth is, they both have issues that the power users just forget are issues because they're used to working around them.
Not compatible with your python version, sorry.
UV venv --python {version}, or alternatively if the repo has .python-version, it's set automatically
Better yet, use a pyproject.toml file.
uv init
will automatically set up a project.toml file with a build backend and version requirements
I meant the .python-version file, you should define the Python versions in the toml as well.
Oh, running this on Windows? Screw you here's an obscure error instead of a clear message telling you the library only supports Linux/Unix systems.
(This was every major AI Python library until 2023)
"running on Windows"
closed as user error
Baka user.
You forgot an argument? Here's the exact implementation of it in it's underlying C implementation! (But hey it does tell you the exact error at the end of the error log, thanks)
Ah, should've used python3.9 instead of python3.12
Nah. This just didnt work for me at all. I literally had to go to pypi and download each whl and manually install each dependency after wrestling with the company proxy because for some reason, pip could not find any modules that are compatible with the environment. I m guessing some funky settings on uat/prod servers by the network team.
Package libobscurev3.2.1 is not available on your OS
Right. If a dev doesn’t remember this then plz don’t be on my team.
The last time I had a dependenc problem was...yeah, wait a sec...ah yes, before containers became a thing 😎
Because needing to ship better half of linux userland, buch of esoteric machinery to configure C groups and user permissions and depending on the underlying platform entire linux vm is a sign of a language that doesn’t have dependency management problem.
is a sign of a language that doesn’t have dependency management problem.
Pretty sure I never said that.
Pythons dependency management is a mess. So is its handling of multiple interpreter versions and isolation of runtime environments. I am merely stating that there is a widespread, easy-to-use way around these problems.
And besides, thanks to the good folks who make uv
even managing dependencies directly on the host system is nowadays a far cry from the PITA it used to be.
It always amazes me how people love all these languages with all this bad tooling/env setup.
Meanwhile you have languages like rust, go, swift that you can pretty much get up and running with a single command to fetch all your dependencies.
It might be because you can build a CNN in an afternoon with like five imports and python
Rust and Java always amazed me with their library management. I love cargo and Maven. Haven't used swift tho
Meanwhile you have languages like rust, go, swift that you can pretty much get up and running with a single command to fetch all your dependencies.
Rust and Go, those I get, but there is none who can convince me that the swift build system isn’t giant pain in the ass, which involves ceremony after ceremony to actually get going.
Do you like janky syntax, supply chain attacks, and abstractions that depend on C?
That is to say, are you a python user?
Consider the crab language.
I am still trying to get used to its syntax. Although I wanna use the crab language the syntax just makes me want to quit it
It takes a lot of getting used to. I've messed with crab before but when picking it back up I struggled with the syntax nonetheless.
Like, when to let mut and when not to let mut. Sometimes, when you make a variable with a long lifetime but assign it in a smaller scope, you might get a warning or error for initializing it as mutable because you only use it after assigning it later. And if the program believes it's only ever going to be mutated once, it might just expect you to let it uninitialized and make it immutable. This can also create a warning or even an error, depending on the situation.
So then you make it immutable, only assigning it once and never mutating it afterward... Until you add more code and suddenly you're mutating it. Then you have to go back and make it mutable.
And that's the *tip* of the iceberg.
Still, after using it a while, I really think it could make a good python replacement, especially if the python version of your program was gonna ship as bytecode or a binary with the python code and interpreter jammed in anyway.
Rust is sadly never replacing python because the extremely vast difference in syntax and their use cases. It can compete, but never replacing it unless rust announces some ground breaking changes that completely changes the way we code in rust
Like, when to let mut and when not to let mut. Sometimes, when you make a variable with a long lifetime but assign it in a smaller scope, you might get a warning or error for initializing it as mutable because you only use it after assigning it later. And if the program believes it's only ever going to be mutated once, it might just expect you to let it uninitialized and make it immutable. This can also create a warning or even an error, depending on the situation. So then you make it immutable, only assigning it once and never mutating it afterward... Until you add more code and suddenly you're mutating it. Then you have to go back and make it mutable. And that's the tip of the iceberg.
None of this is syntax related tho? Rust is ugly… But this is all about semantics and actually the correct way to handle them anyway, there is nothing to struggle with… Like the complicated parts of rust all live in proc macros and combination of async and lifetimes.
Still, after using it a while, I really think it could make a good python replacement, especially if the python version of your program was gonna ship as bytecode or a binary with the python code and interpreter jammed in anyway.
I mean rust and python are basically diametrically opposed. The only sane reasons to ever use python is that it has great standard library and really fast iteration speed. You use rust for everything else the language has to offer in spite of having a standard library that kinda sucks and iteration in it being painfully slow even in comparison to something like C++.
I was away from Python for about 10 years and it was quite disappointing to see how things did not evolve.
NPM and Node module resolution is ages ahead of Python.
- “Oh, but node_modules is huge”
- “bla bla bla left-pad”
These are just testaments of how great is Node’s module management.
I mean sure npm is probably only the second worst package management solution after pip… I would probably take CMake over either of these and CMakes package management is always a guaranteed source of severe mental distress. That’s how bad they are compared to every other ecosystem…
How do you organize a super fragmented ecosystem?
Make dependency management and build system almost like another programming language.
Haha, that's so real.
Me in my cozy corner doing x64 Assembly watching all programming languages burn :0
Just curious, what do you use assembly for currently? I was thinking about trying it for fun but never tried it
I like java
I love python
Dep mgmt is tremendously uncomplicated 99% of the time and once you dig under the hood a few times it's very concrete and predictable.
That said my local machine (personal desktop) is a disaster area loool I need to rip my installations out and re do it
I have been developing using python for over a decade and never had any of these issues. What are you guys developing?
Just a friendly reminder that Python is actually older than Java.
Java stack traces may be long, but if you cannot find where the error is and how it moves from it, the problem is you.
Java 21 has 2 lines of boilerplate now
Long live Kotlin.
To be fair doing something like installing all the modules for python gui setup without an environment manager like anaconda to manage all the conflicting dependencies is truly painful and you will break everything.
But on the other hand curly braces, nah.
I heard that you liked Factory
so I put a FactoryFactory in your FactoryFactoryFactory
So you can FactoryFactoryFactoryFactory while you FactoryFactoryFactoryFactoryFactory
I use whatever language makes the most sense for a given project. I've seen both spaghetti and well-written code in both Java and Python. The fight is imaginary.
Yeah lol. I've faced issues in Java and python, and rust, and JS, and C#. Every language is a pain if you dive deep enough. It's just pick your poison
I can write shitty spaghetti code in over 12 languages and can reinvent the wheel in all modern frameworks.
Ready for management
I can prompt 12 AI models with "fix it" and get even more broken features in more code files
Ready for production
You know the number one sign of a disorganized dev who doesn’t know what they’re doing? Crying over package dependencies.
Keep your shit clean and organized bozos.
And if you use conda then you deserve the pain - that is a disaster of a project.
Yeah sorry, It was my fault for not knowing that x package was using numpy 1.8.9 and y package was using numpy 2
Requirements.txt has left the chat.
Why do anti Python memes always reference bullshit that's not really an issue for anyone other than first month students
Because that's exactly the same for all other languages as well.
Im not a big python user but acting like dependency management is much easier in java is a little silly.
I would love to have Java stack traces only 10 layers deep. But that explains millions of stack traces in Java apps. Java developers don't look into log files.
With the well known logging frameworks you can do this yourself.
Java supplies you with the full stack trace, you can decide what and where to log.
And Java devs look into log files if they do the ops part as well, which is common for DevOps.
I've been using Python professionally for about 8 years now and I've got to say that you guys complaining about all of these errors are really just telling everyone that you are bad at using Python rather than saying anything substantial about Python. I can only infer that Java is some kind of beginner friendly baby's first language if you're holding down a job as a Java dev but can't even manage a Python venv or figure out how to resolve a ModuleNotFound error without breaking down in tears lol
never had those problems so skill issue?
If you don't mind, what projects have you created with python as the primary language?
Mostly computer vision, wrote the backend for my masters thesis with it for web based ar
Ah, nice
Developed on windows? I had a fairly decent experience on windows with python.
But on embedded Linux I just face way too many issues, and it's always pip and some dependency issue
I did the dev work on windows but deployed on Linux (and eventually WSL b/c aws pricing sucks for gpu) so I have experience with both, including getting cuda to work. One of my hobby projects involves running a VLM from source so I can pull out the image embeddings, which was kind of messy too, but I didn't have any package issues that were hard to fix. I did have some trouble with the versioning of the data annotation tool I used b/c it was old but setting the version worked. I had more trouble with packages for the frontend (react js and threeJS)
Ah, so you're blaming Python because you couldn’t handle dependency management on embedded Linux? Bro, that’s not a language issue, that’s a you didn't read the docs issue. Python didn’t fail — your setup did. Try using venv and poetry before throwing shade, champ.
"Read the docs" yes my friend, the docs asked me to run the code in python. The docs made me install certain libraries and they didn't work out, I had to make them work. You should at least know python and C are preferred for embedded Linux, and most documentation suggest it. If you're gonna come at me, at least come with proper facts, rather than a reply copied from chatGPT 🙃
Blaming the language instead of learning how to handle it just proves my point
I think you completely ignored what I said in my comment lol
I just didn’t see the point in blaming a language for stuff not working in embedded linux everyone who’s done serious embedded work knows things break no matter what language you use.
Have you worked in embedded Linux? If so what work?
Don't act like you’re the only one who reads docs.
I never did, it was you who thought of that, I don't read docs in the first place 😄
If you are struggling with that list you are way way WAY too green to even start joking about other languages...
Haha Java homies rise up. I've created my own library over the last 8 years that handles all my boilerplate stuff. If I want to store a POJO in a file I just add @JsonManager("file_path.json"). There's other formats as well..
Then you just do XillaAPI.getObject(YourObject.class, "id")
And I use maven for dependency management myself.
My man 🤜🤛
I'm fine with some shit talking but come on, these are issues that no python dev encounters past their first month with the language.
But I mean I understand. In Java you need the first month to write all the boilerplate for the damn thing to even build.
Is that the thing from 2010's?
bash
uv init
uv venv --python 3.12
uv add yourmodule
If it's hard for you, you are either a first year student or it's better for you to quit software development. Give up. You can't handle a few cli commands
Or you can proceed to code using Java 8 in the cave idk
Btw, using conda is a skill issue too
It's a thing from 2020's
Post controversial meme in a meme subreddit
Rage bait people
People get rage baited
If it's hard for you to understand this, you are either new to the internet, or its better to get off meme subreddits. Give up. You can't handle a reused joke
Or you can proceed to get angry at all the obvious rage baits
Btw, not getting a joke is a skill issue too
Taking seriously any reply with "skill issue" is a massive skill issue. Another proof this post worth nothing, even as rage bait
Ez uncovered
I would slander you more but you also have the Go user flair. I'll let you off with this one.
Like Java devs have never tried getting the right maven dependency or fought with the JVM trying to figure out why shits foobar.
All languages have their foibles, but language x > y jokes are 95% unfunny. And then there’s PHP.
Cope and seethe
Another comment, thanks G
Managing Gradle and maven is actually much more a mess than python dependencies that are really easy to manage with tool like uv or pyenv
Tell me you are new to python without telling me you are new to python.
skiill issue
Well, how many imports does Java need for a meme?
You sure you're not just talking about Theo literally throwing a tantrum and insulting the whole language because he couldnt type "pip install" or create a sandboxed developer environment using just 2 commands: "python -m venv env && . env/bin/activate", even though he is a web developer that deals with npm, and even praised bun?
I'm sure not talking about him
Yall use venv? I use system packages only (totally not potentially problematic with certain packages). Also stack traces aren't that bad, but java boilerplate is pain for me, but I blame the fact I like more simpler code syntax like python, rust, assembly, etc
Cope harder
+1 comment on my post thank you. We making it to the controversial with this one
And then you go to C/C++ and notice that there simply isn't one standard dependency management tool.
I AM the dependency management tool
Oh there is. It's called CMake.
I know it sucks but fuck everything else. Just use CMake. Just do it and stop complaining. Any C/C++ project without a CMakeLists.txt is considered a bug and should have an issue filed over and over again until it's implemented.
A) cmake isn't THE standard it's A standard.
B) cmake isn't a package management solution it's build system with some tools for package management
Many projects are moving away from cmake for several reasons. poor package management and poor build isolation being some of them.
The closest thing to a standard system for finding and using c/c++ dependencies is pkgconfig. However it usually isn't present on windows and is not responsible for installing the dependencies only for announcing them.
If there was a standard C/C++ package management solution msys2 wouldn't exist.
this last sentence is just wrong. msys2 has nothing to do with package management at all. it's an attempt to serve equivalent libraries (.dll) that may only exist on linux systems (.so) within the windows eco system. this is written on the website itself:
MSYS2 is a collection of tools and libraries providing you with an easy-to-use environment for building, installing and running native Windows software.
Yes that is the goal, however msys2 would be a rarely used tool if there was a single proper package manager for C/C++ libraries on windows.
That's not even what their own description even says. All of those libraries exist as pure windows builds, msys provides a streamlined way to fetch them and locate them on your system, like a package manager...
Do you have a list of projects that have 1) used CMake in the past, and 2) have then migrated away to something else, and 3) their stated reasons for doing so.
I'm not calling you a liar, but I can't help but call out your journalistic use of the weasel word "many" and "several reasons" here.
X11 switched to meson. Actually a lot of projects have switched from cmake to meson.
X11 never used CMake. They switched from autotools to Meson. I'm asking about projects that have used CMake and then migrated away from it.
Could you list a few?
I watch The cherno videos. He does C++ code reviews and in almost every code reviews, half of his video is fixing broken packages and CMake scripts. While I don't understand the errors on a deep level, it's what keeping me away from making C++ my primary language
Personally I did C++ for awhile before I went into C, C has alot more control and is just better, and if you need OOP, just use C#, or golang
I guess rust is technically better than C++ but the community and the fundamental un-readable nature of the code - literally gave me a migraine that lasted for afew days - pushed me away after 2 months
Rust isn't unreadable lol, just a little different.
Also, cargo (an actual standard for package management) is great.
I mean the community sucks, and dependency culture sucks, but you can mostly avoid that by just not interacting with the ecosystem. And cargo makes bunch of stuff pain in the ass that’s easy in most C++ build systems, but once you figure it out, it’s not that awful.
But the language doesn’t really have a readability issue, it’s pretty easy to read… The syntax is just inelegant and approaching C++ levels of ugly… But C++ has the same problem, and lot of other languages like C# are even worse so I don’t think ugliness is ultimately what stops people from using something.
Arguably only strong argument in favour of C++ is templates - but it's also reason enough to use the language. I'm yet to find something comparable; various codegen/macro solutions feel much harder to write and use as you go.
And sure, it can be hard to learn and debug (those famous few-screens-long compiler errors), but when used right it's very pleasant to use, especially for unit testing - can easily do proper mocking/dependency injection while keeping dependencies resolved compile-time.
It's the reason I prefer Rust over C++. Cargo is so good.
I hate Rust grammar, I deeply hate it
It took few weeks to get used to it. If expressions are very neat tho.
If you mean the rust syntax, same. Although im still trying to code more and get used to it, it's a great language
Yes, sorry
To be frank, if you're able to, I would generally avoid C++ in this day and age anyway.
I have never ever installed something with Cmake and not had 1 million errors and had to fix them, c and c++ package management is the most garbage of any language
I honestly think the lack of a de jure build and package system will be the downfall of C/C++ more than any of the footguns or warts in the language syntaxes themselves.
I quite like Conan
If it wasn't moving so slowly, was less opinionated and had anything actually resembling a healthy package index (conan-center-index is a joke tbh), yeah, maybe. At least they don't use JSON for their configuration files.
And this is why C has such a fucking bad name, because of people like you
Makefile is better
Ages ago Apple tried something with those
.framework
folders. Did you hear about it?Java has a standard dependency management tool? Maven and Gradle would disagree