Actually… since around Java 21, it’s just
void main() { println("Hello World"); }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?
Printing to console is often only used for toy code anyway.
Wait, how do you debug your code?
A logger? Console prints are shitty in general but especially when you have an actual logger already
You know what println never did? Run arbitrary code on my toaster.
Neither did Log4j in basically all cases, some maniac just put arbitrary code callbacks into their logger, undocumented and enabled by default. The insane part isn’t the feature itself it’s the fact it’s enabled by default in a logger of all things.
Oh man, I thought that was one of the classic jokes :'( I am out of touch
People in my experience are actually very serious about the standard out to debug log which is… baffling. Same people generally outright refuse to learn how to use a debugger in languages where those are pleasant
Oh I’m completely serious. The joke is that everyone does it but everyone knows not to do it. I started doing it when I first ran into problems debugging actor contexts, and never stopped.
The good printlns become logs, obviously
… with a debugger
Meh
Using a debugger?
Guess you could do that, seems like a pain though
???
In more detail, this feature was included as a preview in Java 21 and officially adopted in Java 25.
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.
So what’s your opinion on languages like haskell and erlang, that infer static types?
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.
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
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. :)
For me tapping the video so it would open fullscreen showed the missing last second
Does python run on 3 billion devices?
At this point… yeah, probably so.
I mean, assuming the env and dependencies aren’t totally fucked.
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.
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?









