Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
minisha4915yit was my favourite until I figured out @Builder was adding @ToString automatically. This could potentially leak information in logs.
-
It's essential for modern Java. Data, requiredargsconstructor, noargsconstructor, equalsandhashcode, value, getter/setter, etc etc. Won't code Java without it anymore.
-
@SortOfTested Yeah, my code is littered with boilerplate such as Logger logger = Logger.getLogger(), LogHelper classes and just overall log noise and I've been meaning to get rid of this cross-cutting noise cluttering my applications. My first step was to use Spring AOP, which logs when a method is called, but it doesn't log where I want it to log.. inside a method, on specific lines..
-
RequiredArgsConstructor is extremely useful with Spring. Just declare your fields final and AutoWiring will do the rest. This will pay out when writing unit tests for this Spring component.
-
@SortOfTested If you use it commercially, do you have to incorporate an MIT copyright notice in each class?
-
asgs112755y@CaptainRant most of the apps we build are SaaS now. Unless you distribute it to the users, that's not a necessity. Even then, you could choose to relicense your app and forgo that
-
@PublicByte
I would, but the jvm is garbage and I only write Java when I'm paid to. I'll just keep lombok. -
Lombok is fantastic. A must for all new Java projects. The fact it so happens to be a compiler "hack" is kind of besides the point. It works damn well.
Those saying "har har just stop using Java" are, IMHO, missing the point. For personal projects, sure, I'll use Kotlin these days near universally. I'm not wedded to Java, or any other language, whatsoever. I'll use what's best for the job.
But the fact of the matter is, like it or not, for a lot of businesses Java *is* still the language for the job these days. Good luck persuading your boss to switch all existing Java projects to Kotlin (or heck even start new projects in Kotlin) when Java devs are a dime a dozen and Kotlin devs are... much rarer, shall we say. Lombok offers a nice way to remove a heck of a lot of Java boilerplate while still staying with Java. Sure, it has its quirks and you need to be aware of what exactly you're using it for, same as any framework - but all in all it gets a big thumbs up from me. -
matste6415yHey, I didn’t say to move old projects to Kotlin.
Lombok is fantastic. Total agreement here.
I think your hypothetical boss of a new JVM project overestimates the cost of converting a Java dev into a Kotlin dev. This is not like a conversion to Scala or Closure.
Related Rants
Lombok looks great! The dream of getting rid of boilerplate!
What are your experiences with it?
question
boilerplate
lombok
java