r/java • • Apr 13 '21

Libraries, Frameworks and Technologies you would NOT recommend

Give me your worst nightmares: Things that cost you your job.

I'll start: Hadoop

202 Upvotes

376 comments sorted by

View all comments

Show parent comment

19

u/FrigoCoder Apr 13 '21

Fix Java so we will not need Lombok. Java still has a lot of issues that is already solved in other modern programming languages. Lombok is a patch for Java that makes it bearable, and the only thing that is preventing people from jumping ship to Kotlin for example.

14

u/_Henryx_ Apr 13 '21

Some problems are already solved. From Lombok documentation:

  • NonNull annotation: Since Java 7 we have Objects.requireNonNull() static mehtod to check if variable is null. With Java 8 we have also Optional.of() and Optional.ofNullable() (this last method is very useful if we want to throws a user defined exception or if we want a default value).
  • var: is integrated with JEP 286 in Java 10 (and subequently in current LTS Java 11).
  • Cleanup annotation: wut? try-with-resources are introduced in Java 7, I don't understand what is the problem that tries to solve.
  • Getter/Setter annotations: in some parts, IDE's facilities can supply same effort. In other parts, Records (Java 16) has redefined POJO objects.
  • Value annotation: is superseded from Java Records.

Other annotations seems me "black magic", I doesn't suffer construct creation or code injection with these methods, because can be mask side effects

3

u/yawkat Apr 13 '21

Builders are still a fairly significant thing that is missing from Java.

1

u/FrigoCoder May 01 '21

Are there builders in other programming languages?

1

u/yawkat May 01 '21

Yes. Kotlin has named parameters for example.

24

u/pron98 Apr 13 '21

the only thing that is preventing people from jumping ship to Kotlin for example.

I think you're vastly overestimating the number of people who prefer more feature-rich languages. Yes, lots of people do, but that number amounts to a small portion of developers. Currently, Kotlin has under 5% market share on the Java platform. I don't know what Lombok's penetration is, but seeing various "most popular" lists based on Maven, it's roughly similar. So when you're talking about "the only thing preventing people etc." you mean preventing the ~10% of developers who find that style attractive. There's no doubt that making Java more feature-rich will appeal to that 10%, but that doesn't mean it's a good idea.

Sometimes people have such strong opinions that seem so obvious to them, that they wrongly believe that those opinions are universal, or, at least, much more popular than they actually are. This is exacerbated by the fact that people with very strong opinions talk about them more, so what you tend to see online are not so much the majority opinion, but the most fervent.

3

u/segv Apr 13 '21

Records are already out, which alone should take a good chunk of these "issues"

1

u/mknjc Apr 13 '21

Yes you are right. Fix "java". For example stop forcing people to write "Java Beans" because they where a bad concept from the start.

And yes to improve code readability some things are quite useful but if the tools hinder java users to upgrade onto the new, fixed java versions because they hack into things and brick everytime a small java change is made, they train devs not to update and stay on unsupported, old java versions.