Why is Java so dumb? (Part 2)
A playful look at Java’s entry point, file conventions, and curly-brace culture, and why the verbosity pays off in large systems.
On this page
Haven’t read part one yet? Give it a spin first. The humour is intentional—and so is the reminder that Java’s quirks exist for good reasons.
Let’s talk about Java’s file structure, specifically the *.java files where you write your code. Everyone has seen the jokes about how many lines it takes to print “Hello, world.” Meanwhile, Python and Node.js toss out a one-liner and call it a day. So what gives? Or, in the example below, why so much code just to reverse a string?
Experienced Java developers will point out that StringBuilder::reverse exists, and they’d be right. Still, when you’re coming from a scripting language, a class topped with public static void main(String[] args) can feel like something out of a horror movie. Heck, even C gets by with less ceremony.
Why do we need all this scaffolding before we can do anything useful? Doesn’t it seem excessive—maybe all the time? Did anyone else develop mild depression from reading that Java code, or was it just me (and this kitty)?
Here’s the thing: Java wasn’t designed as a scripting language. If all you need is a tiny automation, you’re barking up the wrong tree. Java’s ceremony exists because the language was built for huge, long-lived systems where structure matters.
Because of that goal, Java imposes a few rules. You can’t just write instructions at the top level and run them. Code lives inside classes. Those classes expose methods. You either call a static method directly or instantiate something to work with it.
The main() method
Here enters the beloved main method in all of its public static void glory. Every word matters:
- public so something outside the class can find it.
- static because no objects exist yet to call it on.
- void because there’s nowhere meaningful to return a value.
Think of main as the contestant on Who Wants to Be a Millionaire. All the other classes are phone-a-friends. They can’t call themselves, but when main needs help it phones one, and work gets done. Import the right friends (classes) and the show goes on.
Another analogy: picture a symphony orchestra. Every musician has sheet music, but the performance only works when the conductor cues each part at the right time. main is that conductor. Without a single entry point, a large Java project would devolve into chaos.
Semicolon madness
No discussion of Java would be complete without mentioning curly braces and the dreaded semicolon. If you’re coming from Python, the braces can look like a mess. Python keeps track of what’s inside what by using indentation. As long as code blocks don’t grow too long, it feels elegant. When they do grow long… well, you either love it or you don’t.
Java’s approach is explicit. Python’s is minimalist. Which is better? Honestly, the debate doesn’t matter much if you’re using an IDE like a sane person. Nobody writes enterprise Java in Notepad. Modern tooling keeps track of braces, semicolons, and indentation for you. Extensions such as Rainbow Brackets even colour-match opening and closing braces so you can see what’s paired with what.
So the moral of the story: don’t reinvent the wheel. Or worse, don’t ignore the wheel and just try to walk everywhere. The tooling exists—use it.
It really boils down to this: Java was engineered for large programs. Yes, there’s more boilerplate required for a simple print statement. But if you’re writing Java solely to print something to the console, the joke’s on you—that’s exactly what scripting languages are for. Java’s extra structure helps teams avoid headaches when the codebase grows huge.
Endnotes
- Yes, Python is fully object-oriented, but it’s often used for scripting. Same deal with modern JavaScript.
- Java’s
mainmethod returnsvoidfor simplicity. Languages like C++ return status codes; Java just prints them. More here: https://www.journaldev.com/12552/public-static-void-main-string-args-java-main-method