Python vs. Java

8 months ago by Ragdoll X to c/programmer_humor

thenextguy 57 points 8 months ago path: 0 21899109, hotness: undefined, score: 57, children: 16
AudaciousArmadillo 14 points 8 months ago

Beyond that, in reality you would write logger.info() in both 99% of the time.

path: 0 21899109 21899324, hotness: undefined, score: 14, children: 0
Solemarc 11 points 8 months ago

I vaguely remember hearing this this was only really available for toy code and that this function created the class ignored the arguments and qualified println when you compiled it, so it wasn't actually that useful?

path: 0 21899109 21903734, hotness: undefined, score: 11, children: 13
bigboismith 5 points 8 months ago

Printing to console is often only used for toy code anyway.

path: 0 21899109 21903734 21904444, hotness: undefined, score: 5, children: 12
silasmariner 7 points 8 months ago

Wait, how do you debug your code?

path: 0 21899109 21903734 21904444 21905414, hotness: undefined, score: 7, children: 11
Traister101 4 points 8 months ago

A logger? Console prints are shitty in general but especially when you have an actual logger already

path: 0 21899109 21903734 21904444 21905414 21905617, hotness: undefined, score: 4, children: 5
firelizzard 2 points 8 months ago

… with a debugger

path: 0 21899109 21903734 21904444 21905414 21954204, hotness: undefined, score: 2, children: 1
Magnum 2 points 8 months ago

Using a debugger?

path: 0 21899109 21903734 21904444 21905414 22101259, hotness: undefined, score: 2, children: 2
justicecoder 1 point 8 months ago

In more detail, this feature was included as a preview in Java 21 and officially adopted in Java 25.

path: 0 21899109 22063170, hotness: undefined, score: 1, children: 0
ExLisper 41 points 8 months ago

I know it's just a meme but Python is seriously the worst language I have ever worked with. Not because of language itself, this is fine for scripting, but because of the terrible tooling. pip is the most unreliable package manager I've seen, packages installed system wide collide with what you're trying to install for you project, environment virtualization and version management is a mess with venv/pyenv and more doing same things differently (the standard can't decide on just one tool for that) and on top of that you have all the ruff/black/mypy and many more offering same features but not really with a new tools coming out all the time. I not a Python expert but even people I worked with that are were confused but all this. I haven't seen such a mess in any other language.

path: 0 21905528, hotness: undefined, score: 41, children: 27
GreenKnight23 10 points 8 months ago

anytime I have to maintain python I do it inside a container. Why? because anytime you deal with pieces of shit directly, you wear your PPE.

everything you said, 10,000% agree. god forbid the Python purists hear it though, they'll tell you that you're just too stupid to understand the language enough to use it and will compare it with literally every language just to prove that they have the "biggest" python.

path: 0 21905528 21906117, hotness: undefined, score: 10, children: 3
tyler 5 points 8 months ago

The main problem is that Python purists have hardly used any other languages so they don’t realize how shitty their tooling is. The most direct comparison is Ruby and the tooling difference is astronomical. I always refer to this article for how bad the situation is https://chriswarrick.com/...

path: 0 21905528 21906117 21913242, hotness: undefined, score: 5, children: 2
GreenKnight23 3 points 8 months ago

the only thing pythonists love more than intellectually dunking on devs is hating Ruby. it's like a universal character flaw they all mistook as a benefit.

path: 0 21905528 21906117 21913242 21913759, hotness: undefined, score: 3, children: 1
tyler 2 points 8 months ago

Yeah it’s pretty crazy, like Ruby was extremely well known for how good its tooling is, so much so that it inspired numerous other language package managers and build tools like elixir’s mix, rust’s cargo, and the lock files in npm and composer.

The testing frameworks everyone uses today are directly descended from Ruby’s RSpec, almost to the letter. BDD and TDD were pioneered by Ruby devs.

Extension functions in Kotlin are a direct result of lessons learned from Ruby metaprogramming while Rust and Elixir’s syntax are both directly inspired by Ruby.

The beauty of Ruby’s DSLs also spread to almost every new language. Kotlin and Gradle DSL scripts are possible because of Ruby.

Rails inspired an entirely new paradigm of web frameworks, where things were supposed to be easy by default. Laravel, Spring Boot, Phoenix, Django all are directly inspired by this, even though Django came out first it wasn’t easy to use.

——

Python gave us… Jupyter notebooks, whitespace which no one uses, and not much else.

path: 0 21905528 21906117 21913242 21913759 21926050, hotness: undefined, score: 2, children: 0
kionay 5 points 8 months ago

Perhaps consider Poetry

It's my personal go-to package manager and venv solution.

path: 0 21905528 21909427, hotness: undefined, score: 5, children: 2
ExLisper 4 points 8 months ago

Thanks, I simply don't use Python. As I said, languages that have to create new tools all the time because the official tools are broken are not my thing.

path: 0 21905528 21909427 21909838, hotness: undefined, score: 4, children: 0
SchwertImStein 4 points 8 months ago path: 0 21905528 21909427 21911400, hotness: undefined, score: 4, children: 0
BartyDeCanter 4 points 8 months ago

I have been using Python as my second language alongside whatever system language I was using professionally as well as for a variety of personal projects for about 20 years. I’m quite fond of the language for the sorts of things I use it for, which is either scripting glue or doing serious math because I hate dealing with Matlab licenses.

And you are so fucking correct it isn’t even funny. Not only is the tooling a disaster, but it seems like every few years there is a new tooling scheme that doesn’t work quite right with the old one and is a disaster in its own unique way. And

I know people get annoyed by rust evangelists, but I started using it six months ago and god damn does cargo slap. Want to initiate new project? One command gives you the complete boilerplate. Adding a new dep? One simple command. Want to pin or unpin a version? One simple command. Want to update all the deps to latest? One simple command. Want make a release package? One simple command. Want to update all your installed packages? One simple command. Want to keep every project tied to a different version? You guessed it.

I definitely have some issues with Rust syntax, but I want cargo to manage my life.

Really, the a Python project needs to take a look at the Zen of Python and apply it to the tooling. And then use cargo to do it.

Edit: And, all of those simple commands work across all platforms the same. None of this, “Everything is perfectly cross platform and is the same anywhere. Unless you’re using a Mac. Or Windows. Or the wrong Linux distro.”

Edit x2: There is, of course, an XKCD for that.

Edit x3: And it’s not just venv. I am constantly struggling with which pip to use on which machine. Is it pip, pip3, pipx, uv pip, conda pip?

path: 0 21905528 21922357, hotness: undefined, score: 4, children: 2
aliser 2 points 8 months ago

each time I start a Python project the first thing I have to deal with is making dependencies work. always some bullshit with python. might be an ide thing tho since I use IDEA.

path: 0 21905528 21922357 21923082, hotness: undefined, score: 2, children: 1
BartyDeCanter 2 points 8 months ago

Nope, not an IDE thing. I’ve never used a Python ide, and have the same issues as well.

path: 0 21905528 21922357 21923082 21923507, hotness: undefined, score: 2, children: 0
Slashme 3 points 8 months ago

pip is the most unreliable package manager I’ve seen,

But have you tried conda? (It's so much worse)

path: 0 21905528 21926737, hotness: undefined, score: 3, children: 0
jenesaisquoi 2 points 8 months ago

Check out uv

path: 0 21905528 21928649, hotness: undefined, score: 2, children: 2
ExLisper 4 points 8 months ago

I simply use cargo 🤷

path: 0 21905528 21928649 21928815, hotness: undefined, score: 4, children: 1
jenesaisquoi 1 point 8 months ago

🦀

path: 0 21905528 21928649 21928815 21929120, hotness: undefined, score: 1, children: 0
Rooster326 2 points 8 months ago

They have changed this but only very recently with the Python Install Manager which forces programmers to develop the way they should have been with venv. Like Sept 2025 recently even though it's been a valid language since 1991..

path: 0 21905528 21911780, hotness: undefined, score: 2, children: 1
BartyDeCanter 1 point 8 months ago

It looks like that is Windows only?!? So there is yet another incompatible tool?

path: 0 21905528 21911780 21922763, hotness: undefined, score: 1, children: 0
evol 1 point 8 months ago

I wish AI came earlier, using python in the age of AI just sucks so much. Only reason to still use it is the libraries

path: 0 21905528 21914194, hotness: undefined, score: 1, children: 1
BartyDeCanter 1 point 8 months ago

Yeah, the libraries are pretty great. I’m working on a kinda personal kinda professional project right now. Ideally it would support reading and writing about seven different sorta obscure file formats. For a bunch of reasons I’m writing it in rust and there is a good library for one of them, multiple half assed libraries for another, and none for any of the others. There is excellent support for all of them as a single Python library. My first step has become writing a comprehensive rust library for all of them.

path: 0 21905528 21914194 21923560, hotness: undefined, score: 1, children: 0
SlurpingPus -2 points 8 months ago

Pyenv and venv are independent and don't do any ‘same thing’, so you must be really talented to mess them up or be confused by them.

I also don't know what's difficult about understanding why the system-wide installation exists or how to add local modules to the path (which venv does for you anyway).

path: 0 21905528 21909527, hotness: undefined, score: -2, children: 8
ExLisper 6 points 8 months ago

Yes, you have to be talented not to get lost in the pyenv ('env' as in 'version' management), venv, virtualenv, pyvenv and god knows what else. All those tools either manager versions, virtual environments or both. Super simple! I'm sure you're enjoying working with them and that's fine. I avoid it.

path: 0 21905528 21909527 21910049, hotness: undefined, score: 6, children: 7
SlurpingPus 2 points 8 months ago

If a programmer needs a whole ‘standard’ to figure out that two orthogonal tools are all they need, it's not a good sign.

path: 0 21905528 21909527 21910049 21910388, hotness: undefined, score: 2, children: 6
ExLisper 1 point 8 months ago

path: 0 21905528 21909527 21910049 21910388 21910625, hotness: undefined, score: 1, children: 5
BlueKey 32 points 8 months ago

I really don't like comparing languages by Hello World complexity. You could use a lang which needs 3 chars to print it but sucks at everything else but it would still look better at first glance.

As for this specific comparison: let the project grow to only midsize and you will crave for static types and well separated classes.

path: 0 21908146, hotness: undefined, score: 32, children: 2
aev_software 4 points 8 months ago

So what's your opinion on languages like haskell and erlang, that infer static types?

path: 0 21908146 21908391, hotness: undefined, score: 4, children: 1
BlueKey 5 points 8 months ago

A good question, as I like it and don't like it. It is without a doubt better than dynamic types.

On the pro side it removes redundant writing the type again and again. On the con side it is almost impossible to see what type with what functions the variable in front of you has without an IDE (which you don't have without cloning the repo) or without an already deep knowledge of the code.

Same with extension functions (free functions which can be added to a type almost anywhere in the codebase). Very useful (Kotlin is a great example for this) but also confusing when you want to hunt down where this piece of code is coming from.

path: 0 21908146 21908391 21921084, hotness: undefined, score: 5, children: 0
ChaoticNeutralCzech 28 points 8 months ago

If you use Voyager on Firefox on Android, the last half-second is missing so you don't get the joke.

This appears:

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    } 
}

and the hamster jumps very high

path: 0 21900646, hotness: undefined, score: 28, children: 2
morph3ous 2 points 8 months ago

Thanks for posting that. I watched using mlem and the end was cut off as well, so I didn’t really get it.

Makes sense now. :)

path: 0 21900646 21904202, hotness: undefined, score: 2, children: 0
LiveLM 1 point 8 months ago

For me tapping the video so it would open fullscreen showed the missing last second

path: 0 21900646 21921881, hotness: undefined, score: 1, children: 0
lukalix98 19 points 8 months ago

Does python run on 3 billion devices?

path: 0 21899174, hotness: undefined, score: 19, children: 3
marlowe221 45 points 8 months ago

At this point… yeah, probably so.

I mean, assuming the env and dependencies aren’t totally fucked.

path: 0 21899174 21899349, hotness: undefined, score: 45, children: 1
lukalix98 1 point 8 months ago

I was only joking, because I'm only tired of this print joke java vs X. But I think you're probably right, especially regarding the python deps and envs.

path: 0 21899174 21899349 21905320, hotness: undefined, score: 1, children: 0
SlurpingPus 3 points 8 months ago path: 0 21899174 21909230, hotness: undefined, score: 3, children: 0
Jankatarch 2 points 8 months ago

On one hand, I heard it's a consistency thing.
On the other hand, do java people write a seperste static singleton class for their isEven function?

path: 0 21926461, hotness: undefined, score: 2, children: 0
programmer_humor
programmer_humor

@programming.dev

login for more options
33615
2560
7290

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn't find it funny, you're banned. Ha-ha!... For real: do not use the community for "statements". There are other places for such content. Keep it chill and funny.

go to feed...