DEV Community

Maurizio Turatti
Maurizio Turatti

Posted on • Edited on

Is Java a verbose programming language?

Short answer: Most complaints about Java's verbosity are based on Java 8-era Java. Since 2014, the language has evolved significantly, and many of those criticisms no longer hold.

Why the "Java is verbose" criticism is outdated

People usually mean three things by "verbose," all of which were largely true in Java 8:

  • Boilerplate-heavy data modeling
  • Clumsy control flow
  • Ceremonial program structure

The real issue

Most people forming opinions about Java today are:

  • using Java 8 at work
  • reading Java 8-era tutorials
  • comparing Java 8 code to modern Kotlin, Python, or Go

That's like judging JavaScript today based on ES5.

The uncomfortable truth

Java is explicit, strongly typed, and conservative by design. Those are not concessions: they are the reason Java systems written ten years ago still run in production today. What Java is no longer is excessively verbose relative to other mainstream, production-grade languages.

The criticism persists mainly because:

  • enterprises stayed on Java 8 for years
  • cultural perception lagged behind language evolution
  • Java optimizes for long-lived systems, not hype cycles

A compact example of modern Java

record User(String name, int age) {}

void main() {
    var user = new User("Alice", 32);

    String category = switch (user) {
        case User(_, int age) when age < 18 -> "minor";
        case User(_, int age) when age < 65 -> "adult";
        case User(_, _)                     -> "senior";
    };

    IO.println("""
        User info
        ---------
        Name: %s
        Age: %d
        Category: %s
        """.formatted(user.name(), user.age(), category));
}
Enter fullscreen mode Exit fullscreen mode

Why this example is interesting

  • No class declaration. Java 25 supports script-like programs without sacrificing type safety.
  • record. Immutable data carrier, perfect for domain objects and DTOs, in one line.
  • Pattern matching in switch. No getters, no casts, no if-else chains.
  • Text blocks. Cleaner multiline output without escaping noise.
  • IO.println. No System.out, no import: IO lives in java.lang and is available everywhere.
  • Still 100% Java. This is not a toy language mode.

Compile & run

Save the code above into User.java. Then:

~ java User.java
User info
---------
Name: Alice
Age: 32
Category: adult
Enter fullscreen mode Exit fullscreen mode

No flags. No explicit compilation step. No build tool. You run a .java file directly, the same way you would a Python script or a Go file, and you still get full type safety, pattern matching, and immutable records. This requires Java 25 or later (java -version to check).

Bottom line

If someone says "Java is verbose" hasn't seriously looked at Java post-17.

Top comments (0)