Live data from Hacker News

Still using java? Lombok can make you more productive

projectlombok.org

1–10 of 36 posts

Re: Still using java? Lombok can make you more productive

#2
It's a cute idea, to use annotations to generate getters/setters etc, instead of generating source code (IDE style). A good strategy for any boilerplate that a particular project requires.

Will other tools find this code? E.g. I think javadoc is source-based, and I don't know if it will invoke such annotations. I would expect the annotation spec to require it, for annotations that can create methods etc, but I'm just not that familiar with the spec.

BTW: great presentation video: showing the problem, showing the solution, showing how to get started. It might seem like overkill, but that's the way to sell stuff (though this one seems to be under the MIT license, ie free).

Re: Still using java? Lombok can make you more productive

#3
post #2

It's a cute idea, to use annotations to generate getters/setters etc, instead of generating source code (IDE style). A good strategy for any boilerplate that a particular project requires. Will other tools find this code? E.g. I think javadoc is source-based, and I don't know if it will invoke such annotations. I would expect the annotation spec to require it, for annotations that can create methods etc, but I'm just…

I'm not sure about source-processing tools picking up these changes. I have heard that the annotation processor is very, very powerful in java, but hardly ever used.

Re: Still using java? Lombok can make you more productive

#8

How retarded, look at Clojure instead

retarded is too harsh :) however the same can be accomplished through macros in a way that is better integrated with the language (when debugging lombok generated code lombok tags are not of much use i would imagine, forcing one to understand the generated code).

something like:

(defdata mountain name :setter :getter latitude :getter etc ...)

might not be too hard to implement on top of clos (or on top of defstruct - but clos has the advantage of already having flexible accessors) not sure about clojure.

Re: Still using java? Lombok can make you more productive

#10
post #9

How retarded, look at Clojure instead

How cavalier of you... never mind that there are many thousands of people who may not have a choice but to use Java. Anything that eases the pain of boilerplate is a good thing.

What are you talking about? Clojure is a lisp for java, written in java and itself, published as a jar.
Post reply on HN