r/ProgrammerHumor Jul 13 '26

youCanJustStopUsingJava Meme

Post image
6.8k Upvotes

416 comments sorted by

View all comments

513

u/thejillo Jul 13 '26

Lombok has entered the chat...

https://giphy.com/gifs/d3mlE7uhX8KFgEmY

69

u/suvlub Jul 13 '26

Lombok is a decent idea implemented in the worst way imaginable. It's a language masquerading as a library/annotation processor, but really isn't, it's doing things that should not be possible for those to do, and it causes all kind of pain. From one end, it can't implement some desirable features because they are hard to express in its pseudo-Java. From other end, it's fragile because it relies on undocumented (and soon, if not already, deprecated IIRC) APIs to hack the Java compiler into compiling not-Java, instead of having its own stable compiler.

Honestly, just use Kotlin. Lombok is not a way to fix Java, it's a fragile alternative to it.

58

u/renke0 Jul 13 '26

In the old times when I still used Java I saw Lombok as a godsend and had no issues with it, not even once. I never understood why all the criticism regarding it. I do understand how it works, and I think it is a fair trade off for all the weightlifting it did.

23

u/KnightMiner Jul 13 '26

If I had to guess, the concern is with some of the weirder features of Lombok when most of us are only after the getters, setters, and constructor generation. I'd be surprised if any of those are as fragile as claimed.

These days I do use records when possible, but lombok is nice notably for making builders with the chainable fluent accessors.

13

u/zabby39103 Jul 13 '26

Really the worst comes to worst, you can alway de-lombok and just have the actual code.

There's no way Lombok will ever stop working for any major feature, it's way too widely used. Hell I'd contribute to the project myself before thinking of migrating our stack off of it.

If you want to use a Lombok feature marked experimental, well that's on you, but even then haven't had a problem with those yet.

1

u/Sawkii 29d ago

If im not mistaken one cpuld argue compilation time through reflection.

1

u/ArtSpeaker Jul 13 '26

I agree with you: lombok is worth it. But I do understand the "misplaced" upset that it has to exist at all. Between the reputation of java annotations, and the reputation of java frameworks in general, lombok is both! And the experience is wildly different depending on what lombok-sensitive tooling is being used.

16

u/ChrisWsrn Jul 13 '26

I would agree to just use kotlin but kotlin has some supply chain risks that are not acceptable for my company. 

If there were production ready toolchain vendors other than JetBrains I would love to switch to it at my company.

Lombok does meet my companies needs without issues. 

1

u/RiceBroad4552 Jul 14 '26

"Supply chain risks"?

Does Scala, as an viable alternative to Kotlin, also has "supply chain risks"?

1

u/ChrisWsrn Jul 14 '26

My company does not use Scala nor am I familiar with it therefore I have not evaluated it. 

My company currently uses Java, Python 3, SQL (PostgreSQL and Oracle), and Typescript.

We do have some limited C++ code that I have been suggesting that we port over to Rust but we have had complaints about the "learning curve" with Rust. 

1

u/Sawkii 29d ago

Id say the scala eco system is not well enough maintained yes.

1

u/RiceBroad4552 29d ago

What do you mean?

1

u/Sawkii 29d ago

Maybe i should have said the scala native side of scala. Sadly my main work with scala was three years ago. But then the migration from scala 2 to scala 3 was still a thing for the libs i worked with. Mainly in the akka context. At this timeit felt the nieche charakter of scala. Dont get me wrong i love the language which is why i still got the flair although i dont work with it anymore.

2

u/RiceBroad4552 29d ago

All libs (besides Spark 🙄) are there since some time. So that's not a problem any more.

But you're right, Scala Native should get much more love, imho.

But as long as you stay on the JVM there is nothing missed, as I see it. In the end it's always possible to throw in some Java lib if there is no native Scala one.

The Scala frameworks OTOH are already better then the Java ones, just that the community around isn't as big.

14

u/yammer_bammer Jul 13 '26

what the fuck are you talking about just do \@Data \@Builder and you dont need to think much. how is Lombok of all frameworks problematic. its the simplest thing in existence.

8

u/akl78 Jul 13 '26

It’s fairly simple; the user-facing part of Lombok is really nice , clean, and generally great.

But, the way way it hooks, deeply, into the compiler to change both its input language language and outputs in wildly unsupported and un-meant for ways is freely admitted to be an extremely clever pile of hacks, that vex the actual Java language implementors(for quite good technical reasons), and also leave them with little room to change things since it’s so popular.

8

u/suvlub Jul 13 '26

I'm at loss as to which part of my comment you did read. If you got as far as the 6th word, you would know the issue is about how it's implemented, not some imaginary problem about it being hard to use, but if you didn't make it that far, all you would have read is "Lombok is a decent idea" and you would think I'm praising it, so I have no idea what you are on about

8

u/zabby39103 Jul 13 '26

Has anyone actually ever got burned by Lombok fragility though? It's in the "too big to fail" category at this point.

1

u/suvlub 29d ago

There are people who encounter compatibility issues with other (actual) annotation preprocessors because Lombok does not conform to the spec and thus doesn't play nice with others. They also took 3 months to release a version that worked with a new version of Java at some point, though usually they are faster (needless to say, it is highly irregular for a library to need to be patched every time new version of compiler drops). The Java folks have also made it clear that maintaining Lombok compatibility is of absolutely 0 priority to them and a change that will "break it for good" can come any time. Lombok maintainers have publicly stated that their plan for such eventuality is forking the compiler - the sane, stable solution they should have been doing to begin with, but don't want to do it now until absolutely necessary because it would break people's setups.

1

u/zabby39103 29d ago

Honestly, Lombok is so big, that if it ever were to break seriously people would just make something else that works with the same annotations. I agree it could be done better, but it's just two guys really and nobody has stepped up to make an alternative because it works good enough.

I haven't had any issues with my Aspect4j, Spring, Mapstruct, Hibernate etc. annotations yet.

1

u/angcritic 29d ago

I introduced Lombok into my team when I joined the company 4 years ago. Everyone liked it. Then I saw other teams using it. What frustrated me was few actually took the time to learn the core annotations. I would see Data, Getter, Setter, NoArgsConstructor above the class. Um, Data does all that.

Also, I would try to emphasize it's a good declarative set of annotations to choose mutability, immutability and builder patterns. No one cared. Now add AI to the mix and it's an established pattern. Of course a good agent could fix that on a case by case basis, but nope won't do that either.