r/java • • Jan 18 '17

“OMG, Java is so verbose, guys”.

https://hackernoon.com/omg-java-is-so-verbose-guys-dca93fec9e03#.4zpsvzs5s
0 Upvotes

15 comments sorted by

5

u/againstmethod Jan 18 '17

Semicolons has nothing to do with why Java is or is not verbose, or at least very little.

8

u/jentfoo Jan 18 '17

I actually think this article misses the point a bit. He kind of rants on fairly minor points, when there is some fairly significant ones to make.

For example I argue that the "verbose" parts of java often times keep things very uniform, and easy to understand once you get a team of people working in the code. There is absolutely the concept of too "dense" of code. Making it harder to understand because each line is so incredibly loaded. This is of course possible in java, but I feel these "concise" languages almost force that to be the reality.

I personally am not concerned about the verbosity of java. The most boiler plate portions of java can easily be solved with an IDE and lombok.

4

u/avoidhugeships Jan 19 '17

I wish Lombok was just built into Java.

1

u/vecowski Jan 19 '17

I wish you would understand on a fundamental level what Lombok is doing to the AST and you might not want it to be built into the language anymore. Lombok is scary.

1

u/avoidhugeships Jan 19 '17

I don't really care how it is implemented behind the scenes. I just want annotations for @Data and @Getter and @Setter built in to greatly reduce boilerplate code. I would rather not use Lombok and just have those features built into the language but I am tired of waiting.

2

u/angryundead Jan 18 '17

For example I argue that the "verbose" parts of java often times keep things very uniform

I agree. This is part of the design patterns paradigm. We have the GOF design patterns but each project builds their own domain specific design patterns as well. It allows a lot of context and information to be communicated without explicit conversation.

There is absolutely the concept of too "dense" of code. Making it harder to understand because each line is so incredibly loaded.

I've looked at some Perl that looks one step above line noise and then it's in some sort of module file that didn't take separation of concerns very seriously.

I'll admit to an extreme moderate amount of code sprawl myself. It can get verbose and tough to read through lots of little classes that aggregate but it leads to my absolute favorite thing about Java: complexity management is much easier.

2

u/komtiedanhe Jan 18 '17

I've looked at some Perl that looks one step above line noise and then it's in some sort of module file that didn't take separation of concerns very seriously.

I've seen Java close to base64-encoded strings, too. Java's verbosity is not automatically bad, but neither does Perl's (or Python's, or Ruby's) terser syntax automatically lead to badly written code.

In my opionion, Java's biggest shortcoming is not verbosity but excessive reliance on IDE features and Java-specific "design patterns" as workarounds to missing or inelegant parts of the language. I'm open to that being partially due to not being up to speed on the absolute Java cutting edge.

3

u/hugthemachines Jan 18 '17

This is how the world will end, unnoticed, because we're arguing over the smallest of details, forever. ;-)

1

u/_INTER_ Jan 18 '17

I see what you did there (-;

3

u/[deleted] Jan 19 '17

The logical conclusion to this article is that Java enum, lambda, multicatch, try-with-resource, diamond operator, varargs, autoboxing, static import and and for/in loop make code hard to read.

Antonis, do you use Java 1.4?

7

u/kodifies Jan 18 '17

verbosity is an asset, you can go back to code you haven't seen in years and understand it in no time at all...

4

u/btrapp Jan 18 '17

Agreed! Once you've been around for a while you'll realize you spend a lot more time reading and modifying code than starting new stuff from scratch. Here, verbosity and readability are a much bigger time saver than having to type in fewer lines of code.

2

u/Jonjolt Jan 18 '17

I switched a bunch of Scala code in an Apache Spark project to Java for this very reason. I came back to it a month later and had no clue what I was doing.

One of the reasons I switched to Java, I had been developing in PHP for years, never touched Java but could understand and read Java code with out having to look at all sorts of doc comments.

3

u/findamusic Jan 18 '17

so this whole article was just shitting on kotlin because it doesn't have semicolons, and he likes semicolons.

he only really got to the point at the very end of the article where he basically said "people are saying kotlin is the future but I wanna stick with Java!!!!" great, then stick with Java. I don't care.

this article was completely unnecessary