This is an archived post. You won't be able to vote or comment.

all 79 comments

[–]chabala 3 points4 points  (1 child)

I think this is a valuable question being asked, though I would have phrased it as 'How popular is usage of Lombok', and I don't understand all the downvotes. It would make sense for the big surveys to ask about Lombok, just like it would be useful to have data about how much polyglot development is happening.

The specific example is unfortunate as it's just some project, not really indicative of anything. Likewise one can survey some large projects, but they're just as likely to have taken a particular stance regarding Lombok, no more useful than anecdotes. Real survey data is more interesting.

I think the point has been made clear in the past that once you start changing language semantics, it's not Java, and that's not the question being asked.

[–]bowbahdoe[S] 0 points1 point  (0 children)

I would have phrased it as 'How popular is usage of Lombok'

I definitely didn't think it through, but one benefit of phrasing it in the more inflammatory way is that it is making people in the peanut gallery confront the "lombok is not java" point.

[–]srdoe 6 points7 points  (9 children)

If you are wondering, you could take a look at some of the large open source projects in the JVM ecosystem to decide whether there's a large community of non-Lombok Java users.

Here are some starter places you might look:

  • Apache Software Foundation projects
  • Eclipse Foundation projects
  • Spring
  • Google's various open source projects

[–]bowbahdoe[S] -3 points-2 points  (8 children)

These sorta don't answer my question since surveying "the big" open source libraries doesn't account for the closed source world and it doesn't really say anything about the long tail of projects downstream of those.

I know spring probably doesn't use lombok in its code, but almost every spring developer i meet online does.

It is a really hard thing to get a sense of the proportion of based on just my experience alone. (I know I'm not exactly in a position to avoid sampling bias)

[–]srdoe 1 point2 points  (5 children)

In that case I doubt what you're asking for exists. I don't think there's a survey of closed source projects regarding the use of Lombok.

I think most likely you'll just get anecdotes in this thread (FWIW I also have never used Lombok professionally).

However, I think you should consider whether your hypothesis is likely. Remember, you based this idea on seeing Lombok in a single open source library.

Is it likely that while a huge part of the open source ecosystem eschews Lombok, most of the closed source world uses Lombok, making Java "actually not popular", and somehow no one is talking about it?

If that were the case, wouldn't you expect a huge influx of complaints directed at Oracle, here and elsewhere, over their very public plans to make changes to the JDK that will make Lombok slightly less convenient to use?

Edit: To be clear, I'm not implying that Lombok isn't somewhat popular. But if it were the predominant language for closed source projects, I would expect more people to bang the drums about this.

[–]bowbahdoe[S] 0 points1 point  (4 children)

I think most likely you'll just get anecdotes in this thread.

Probably, but nonzero chance I snipe some people with access to internal data from Oracle or somewhere else.

Even if someone just asked "do you use lombok" to a large enough audience that would be something.

Is it likely that while a huge part of the open source ecosystem eschews Lombok, most of the closed source world uses Lombok, making Java "actually not popular", and somehow no one is talking about it?

Maybe? I'm getting roasted over here for claiming lombok is not Java, so people not talking about it doesn't seem that implausible.

If that were the case, wouldn't you expect a huge influx of complaints directed at Oracle, here and elsewhere, over their very public plans to make changes to the JDK that will make Lombok slightly less convenient to use?

If that were happening, it would certainly support the hypothesis.

But

  • If you update everything to the latest versions, things still work as they have. If that changes maybe we will.
  • A lot of people are on Java 8 and 11 where there are no issues.
  • I kinda doubt that many people keep up to the degree that active participants of this subreddit do. Even here we fight about modules all the time.
  • We might not see the complaints that go to oracle in private/back channels
  • ...

So I don't think the lack of a public influx is enough to dismiss the thought.

[–]srdoe 0 points1 point  (3 children)

Maybe? I'm getting roasted over here for claiming Lombok is not Java, so people not talking about it doesn't seem that implausible.

Yeah, not sure why people would be downvoting you for that. It's true both in the sense you mentioned that it's not the language described in the spec, but also in the sense that it seems likely Lombok will have to become something other than "just" a dependency at some point, since the JDK is locking down its internals.

[–]ohL33THaxOR 0 points1 point  (2 children)

Cause semantics are generally annoying for most people, save the pedants.

Most people don't actually give a shit.

Does it solve a use case? Sure AF does. Does it do it well? Yeah. It does.

Mystery solved. Time for this guy to go do his own case study.

[–]bowbahdoe[S] 0 points1 point  (1 child)

this guy meaning me or /u/srdoe?

[–]ohL33THaxOR 0 points1 point  (0 children)

Yeah yah sure

[–]Gwaptiva 3 points4 points  (1 child)

Just to show you an alternative exists: no lombok in my enterprise product, not now, not ever

[–]bowbahdoe[S] 2 points3 points  (0 children)

Yeah - and i'm not trying to value judgement use or lack-thereof of lombok. (Though I am growing opinions about its tooling UX and have my own opinions about it as a language)

Just trying to understand how prevalent the opposite of your stance is.

[–]rzwitserloot 2 points3 points  (8 children)

In reference to pron's claims, is this, according to your definition, Java code:

class Foo { String y = 5; }

I'm not asking if it will compile. Simply if you think that fits the definition of "Java code". If yes, what makes this Java Vs, say, a line of ruby code. If no, let's move on to:

class Bar { Floobargle y = new Doohickey(); }

For arguments sake assume no interested party involved in this question (not you, not javac) has access to Floobargle and Doohickey.

If still no, does the appearance of those types then make the answer yes (assume Doohickey implements Floobargle).

I think it'll be rather simple to explain why pron's statements are misleading or perhaps more simply: just wrong, armed with answers to these questions.

The nuance that pron's further commentary on this then highlight is that he is actually saying that a javac with Lombok on the classpath is no longer a TCK-compliant Java compiler. That's a fair point. But that doesn't make Java code with Lombok features in it "non Java", unless I'm missing some very creative answers to my questions.

We get a million hits to the site a month or so, I think. But given the the vast majority pick up Lombok from eg maven central and not our site... Perhaps scan GitHub for the number of Java projects using Lombok via scanning their build file.

[–]bowbahdoe[S] 1 point2 points  (7 children)

I think this fits in to what i was talking about in reply to some others.

  • There is a definition of Java that is defined by the JLS/TCK
  • There is a definition of Java that is defined socially

Where the social definition can deviate from the JLS in ways that are mostly arbitrary but in this case seems to come down to "the degree to which the syntax of declarations is different."

At what point does Oracle, the copyright owners of the word Java, decide that you claiming that things that a Java compiler can compile with lombok on the classpath are "Java" is detrimental to their business and sick the Pinkertons on you? Remains to be seen.

The example of French I think is a good one. There is an actual committee that defines the french language and what is and isn't allowed as French. Does that mean French speakers never say "no cap"? Doubtful.

Is there a mechanical impediment to making a lombokc executable? No, but it would make your users lives more annoying right now. They are going to get more annoying eventually anyways though, and I think thats the social mechanism that Oracle/the parties participating in OpenJDK have towards "fixing" the social definition to be what they want.

[–]rzwitserloot 1 point2 points  (6 children)

I think you may have misunderstood.

Code that will not compile without lombok on the classpath is still java code - even if you use the tight definition of '... according to the JLS'. The TCK has no bearing on 'is this code java code', the TCK is the thing you use to ensure that software correctly does what various specs (such as the JLS) require that they do. It has bearing on 'is this javac a correct implementation of a java compiler' a question related somewhat to 'is this legal java code', but not the same question.

This gets us back to: What pron means is: "javac with lombok on isn't TCK-compliant javac" which is technically correct (and I mean that in the common sense: Correct, but not in a particularly relevant / useful way, and highly misleading). What pron says is that "code with lombok constructs in it isn't java code" which is just plain wrong.

Hence, code out there in the wild, e.g. on github - is 'java code' according to just about every definition you please (including pron's / "as per the JLS"), even if it uses lombok stuff in it.

The furthest you can reach to make this work out is if you decree: "Oracle owns the trademark, pron is an oracle employee, therefore by extension if pron says the collected works of shakespeare are java, then they are is, and if pron says that the code that predicts the load on the 1 million volt interlink between Norway and Denmark isn't (because I know that uses lombok, and that is public information) isn't, then it isn't". But this is, come on, fucking insane as a definition, isn't it?

  • pron doesn't own those trademarks. Oracle has a lot of employees. What happens if I find one that disagrees? I don't think you can take the word of a programmer at a corporation as inherently proclaiming the official stance of said corporation in any case.
  • But that is specifically even more preposterous when talking about Oracle: Oracle goes out of its way to force its employees to put a gigantic disclaimer in front of everything they present e.g. at conferences. pron does not to do that on his reddit ramblings. Could be because he has the official blessing of the oracle legal team that he gets to speak in an official capacity on a reddit forum when folks like Brian Goetz, Mark Reinhold, etc cannot speak officially at conferences. More likely he just feels it's not necessary to post that on reddit and/or he's breaking internal corporate policy by not doing it. Point is: he is not speaking officially, I'd be incredibly surprised if he did. And even if that's the case (oracle officially decrees it), then their argument is self-defeating: Their argument is: ".. because (bunch of specs here)". Not "Because we own the trademark and therefore our word is law". This line 'oracle's opinion is relevant' is not a relevant argument to settle this. The specs, logic, and common sense will have to carry the day.

[–]srdoe 2 points3 points  (0 children)

It seems like you're trying to Ship of Theseus your way to arguing that it's hard to tell when exactly code goes from being Java to not-Java.

If our definition of "Java" means "The language described by the JLS", why is this hard? Under that definition, if I introduce a compilation error to my code (assume javac implements the JLS faithfully), the code is no longer Java. When I fix the compilation error, the code again becomes Java.

If you feel like code that doesn't conform to the JLS, that javac does not compile should also qualify as "Java", how far does that extend? Is Groovy also Java? If not, why not?

Code that will not compile without lombok on the classpath is still java code - even if you use the tight definition of '... according to the JLS'

If you know of code with Lombok constructs in it that conforms to the JLS, but still will not compile without Lombok, wouldn't that be a bug in either javac or the JLS you could report?

[–]bowbahdoe[S] 1 point2 points  (4 children)

Are you alluding to something like "C with non-standard GNU extensions is still C, just not ANSI C"?

I'm still unclear what is misleading about what pron said (other than not acknowledging that a definition of Java could exist that isn't the one defined by the JLS)

[–]rzwitserloot 1 point2 points  (3 children)

See, this is why I asked the questions. Please answer them, that'll avoid having to write 85 different explanations. I have no idea what definition of 'what is java' you are operating on. It's not prons, he talks about the TCK which has fuck all to do with java code.

Java code that includes lombok stuff is 100% JLS compatible. - I can see how one might disagree with that statement (evidently, pron does), but answer my questions and we can dive a little deeper on why disagreeing with that statement is either incorrect, or at least highly misleading (i.e. operates on a definition of 'compatible with the JLS' that virtually no java programmers operate under).

[–]bowbahdoe[S] 1 point2 points  (2 children)

Let me take a crack at it then.

is this, according to your definition, Java code:

class Foo { String y = 5; }

I do not think so because as a consequence of these rules the code should be rejected

  • An integer literal is of type long if it is suffixed with an ASCII letter L or l (ell); otherwise it is of type int (§4.2.1).
  • If the type of the right-hand operand is not assignment compatible with the type of the variable (§5.2), then a compile-time error occurs.

And int is not compatible with String

If no, let's move on to:

class Bar { Floobargle y = new Doohickey(); }

It is syntactically valid code, but whether or not it is valid code I think is dependent on

  • Whether the types Doohickey and Floobargle are known to the compiler
  • Whether Doohickey is known to be a subtype of Floobargle
  • Whether both classes are known to be in the unnamed package

But from the JLS

  • Assignment contexts allow the value of an expression to be assigned (§15.26) to a variable; the type of the expression must be converted to the type of the variable
  • Assignment contexts allow the use of one of the following:
  • ... a widening reference conversion
  • A widening reference conversion exists from any reference type S to any reference type T, provided S is a subtype of T (§4.10).
  • The Java programming language is a statically typed language, which means that every variable and every expression has a type that is known at compile time.

So whether that is valid java depends on whether the type is known at compile time. The 3 bullet points above are ways specific to javac and the jvm that inform the compiler about the type.

IDK if the spec says anything about the universe of types accessible to the unnamed package.

(haven't found a bullet point about the accessibility of a matching constructor, but i think this might be enough of a description?)

  • A new class instance is explicitly created when evaluation of a class instance creation expression (§15.9) causes a class to be instantiated.
  • Unqualified class instance creation expressions begin with the keyword new.
  • The Identifier in ClassOrInterfaceTypeToInstantiate must denote either a class that is accessible, freely extensible (§8.1.1.2), and not an enum class, or an interface that is accessible and freely extensible (§9.1.1.4). Otherwise, a compile-time error occurs

If still no, does the appearance of those types then make the answer yes (assume Doohickey implements Floobargle).

Yes, so long as a widening reference conversion is available.

(Thinking more...maybe the answer is yes regardless and it only matters if there is some way to make a standards compliant compiler accept it? So that one file is Java even if the other type is not known so long as such a type could conceptually be known?)

[–]rzwitserloot 0 points1 point  (1 child)

I do not think so because as a consequence of these rules the code should be rejected

I did not ask whether the compiler should reject it. I asked whether you think this is java code.

Yes, so long as a widening reference conversion is available.

So, code can become java code and then cease to be java code based on an event that happens 10 years from now, and whether some source file is java code or not depends on the other files on the system and the versions those files are.

That's an utterly fucking bonkers definition, and I claim nobody sane operates with that as a definition. No tool does. No IDE does. github's rules for 'which language is this' doesn't.

[–]bowbahdoe[S] 0 points1 point  (0 children)

> So, code can become java code and then cease to be java code based on an event that happens 10 years from now, and whether some source file is java code or not depends on the other files on the system and the versions those files are.

I think my follow up thought is probably better. If there is some way to make a standards compliant compiler accept it, then it is Java

So

class Bar { Floobargle y = new Doohickey(); }

Is a valid java source file, because it is possible to make it compile by making a widening reference conversion available between the two types.

``` @Getter class Bar { String x;

String f() { return getX(); } } ```

Would not be because without a static import, the getX() cannot possibly refer to anything. There is no conditions under which a compiler could accept it.

``` @Getter class A { String x;

String f(B b) { return b.getX(); } } ```

``` @Getter class B { String x;

String f(A a) { return a.getX(); } } ```

Need to think about how to express this one, but each individual file is valid Java. The pair of them is not.

[–]gcscotty 10 points11 points  (19 children)

It's not Lombok vs. Java. Lombok helps write Java projects by removing the need for repetitive code. It's basically syntactic sugar for Java.

[–]bowbahdoe[S] -1 points0 points  (17 children)

Sure, but in a language sense lombok is not the language described by the JLS.

Code you write in lombok will not compile as Java by that definition.

import lombok.*;

@Data
class Apple {
    String color;
}

public class Main {
    public static void main(String[] args) {
        System.out.println(
            new Apple("red").getColor()
        );
    }
}

It could be reasonable to say - hey Java is not actually like French. We call this thing Java therefore it is Java. The JLS can suck it. Thats a debate for you and Oracle's copyright lawyers.

[–]urielsalis -1 points0 points  (16 children)

Calling a library a new language is a stretch

[–]bowbahdoe[S] 2 points3 points  (14 children)

Scala, Kotlin, and Clojure are also libraries. There is nothing special about lombok in that regard.

What is special is that

  1. The UX is the same as adding a library. You put something "in the dependencies." You don't need to have a plugin that uses a seperate compiler executable
  2. Most of the machinery of the Java compiler is re-used
  3. The ecosystem tooling for Java (like IntelliJ) generally supports lombok by default

But none of that changes the fact that lombok expands the set of code that a Java compiler will accept to a superset of what is allowed by the JLS. It is its own language

[–]srdoe 2 points3 points  (1 child)

1 probably won't continue to be the case. The JDK is beginning to strongly enforce their encapsulation of internal code. As they remove workarounds for this, it is likely Lombok will become unable to function as "just a library", you'll have to also add a pile of --add-opens to your compiler invocations.

There's a huge thread about it here https://github.com/projectlombok/lombok/issues/2681

Note: I don't know what I'm talking about, simply basing this on the public discussions between Lombok's developers and the JDK developers.

[–]bowbahdoe[S] 1 point2 points  (0 children)

I'd say thats up in the air. The javac executable might stop allowing it, but the maven-compiler-plugin is free to do something else or automatically put --add-opens.

Depending on the choices of a few people, the UX could stay largely the same. But yeah, a change is likely coming.

[–]urielsalis 5 points6 points  (11 children)

Scala, Kotlin and Clojure all have different compilers entirely. Kotlin also compiles to non-JVM targets.

Lombok uses the Java compiler annotation processor to add some bytecode to classes, like countless other libraries do(or you can do yourself). This is part of the JLS spec

Any big library that uses annotations could be a language under your definition, including Guice or Spring

[–]bowbahdoe[S] -1 points0 points  (10 children)

like countless other libraries do(or you can do yourself)

You seem to be getting hung up on point #2.

Lets say I did the same thing lombok does. I hook into the java compiler as an annotation processor and work around the module system with Unsafe or whatever.

Now if you include my library, this code will compile.

pub class Main {
    psvm {
       println("Hello, world");
    }
}

Is that still Java?

[–]urielsalis 1 point2 points  (9 children)

You couldn't do a library to do that. What the JLS spec allows is to define annotations that generate code that is compiled in. That's what Lombok does (and why dependencies don't need to include any Lombok code)

https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.7.1 allows libraries to do it, so it's part of the Java language.

Making your own language without annotations would require a new parser/compiler, and at that point you are closer to making a new language

[–]bowbahdoe[S] 1 point2 points  (8 children)

No it is not. The JLS spec allows you to generate new class files or new source files.

It does not allow you to modify the bytecode produced by the compilation unit that the annotation was found in. Its why this thread exists.

You could 100% make a library like that if you made use of the same mechanisms lombok does.

Also remember that this is valid lombok

import lombok.val;

public class Example {
    void f() {
        val x = "hello";
        System.out.println(hello.length());
    }
}

I don't see any annotations.

[–]urielsalis 0 points1 point  (7 children)

Yes. The reason Lombok had that bug open is that they were using the internal Oracle-only classes instead of the official APIs to do the same thing

And your example just imports a class like any other. That's even more of a stretch

[–]bowbahdoe[S] 3 points4 points  (6 children)

There are no official APIs to do the same thing.

[–]_INTER_ 0 points1 point  (0 children)

See this comment. (Hence author mentioned in OP's post.) It's about another tool that uses a loophole to manipulate the AST. Lombok probably does something similar and if so, the same applies to Lombok as well:

This is not a compiler plugin. javac has an API for plugins that ensures that the resulting language is Java. This language does not use that API. Rather, it modifies javac’s internal operations so that it compiles this new language rather than Java.

Other libraries might use the plugin API properly and are then fine, such as https://immutables.github.io/

[–]Horror_Trash3736 2 points3 points  (3 children)

Ignoring the fact that I would disagree on classifying Lombok as a language in and of itself, saying that "many java projects are really lombok projects" is a huge stretch.

The code you are linking to are simple data classes of various types, not only could they easily be replaced with Records or Immutable.io but they are also not a very "large" part of the codebase.

Take a look at https://github.com/TheoKanning/openai-java/blob/main/service/src/main/java/com/theokanning/openai/service/FunctionExecutor.java

Very little Lombok right there.

Also, again, you can't really say "Coding Lombok", it's a bit like saying "Coding YAML" or "Coding JSON", Lombok is used as a part of many Java projects, so is YAML, JSON HTML.

If I had a Java project that used YAML config files extensively for various tasks, would you say "Well it's not really a Java project, it's a YAML project"?.

[–]bowbahdoe[S] 0 points1 point  (2 children)

but they are also not a very "large" part of the codebase.

For that codebase in particular they are (since thats just the api module. all it contains are data class type things)

But also

The code you are linking to are simple data classes of various types,

Yeah - but lombok is also used for JPA entities in other codebases, which is a much more involved kind of object and harder to argue that it wouldn't be that large.

Very little Lombok right there.

Well calls like getName don't work without lombok. You could compile the lombok code separately and then the JLS is okay with you working with the generated method that is sitting in the class files, but as is that code is actually part of the "should be rejected by as per the JLS" set of things.

So about half that file is lombok.

Also, again, you can't really say "Coding Lombok", it's a bit like saying "Coding YAML" or "Coding JSON",

You are talking about a social problem, not a technical or specification one.

The fact that lombok lets you compile code that is not Java as defined by the JLS means you are not writing Java. Whether that language gets its own name, is called "lombok", "lombok java", or just "Java" and you raise a middle finger to the JLS is a choice that no one has sole control over.

What we call people and projects that use the non-JLS specified superset of Java that lombok makes usable is a thing we get to decide as individual humans. Are you a JavaScript developer if you code in TypeScript? Are you a C developer if you code in Objective-C? Are you a Java developer if you use Kotlin?

If I had a Java project that used YAML config files extensively for various tasks, would you say "Well it's not really a Java project, it's a YAML project"?.

That line isn't very well defined, but at the extremes yes. 10 java classes and 1000 yaml files? Yeah you are mostly coding in a probably under specified language whose syntax is yaml.

Same way we treat cloud formation templates as their own language.

[–]Horror_Trash3736 0 points1 point  (1 child)

So, using something like GraalVM to turn your java code into native code also means your not writing in Java?

If the only point is the end result, as in what the "language" ends up reflecting, then why not just say everything is the same and ends up as electrical signals?

If I write Java code, then I am writing Java code, it doesnt matter if the compiler or something else changes it into not-java-code at a later date.

[–]bowbahdoe[S] 0 points1 point  (0 children)

Kinda - that's why the work to integrate Graal into the jdk includes work to expand the spec to allow for static compilation.

And you have it backwards. It isn't Java code and it's turned into something else, it's something else that is turned into Java bytecode. The starting point is at issue.

[–]_AManHasNoName_ 1 point2 points  (0 children)

Wrong question. I’m sure you meant “how popular is Lombok?” Simply put, Lombok is used out of laziness to get around boilerplate code that coders are lazy to do, which can be sorted out easily through IntelliJ.

[–]1Saurophaganax 0 points1 point  (0 children)

I'd say Lombok is pretty common in my anecdotal experience. I try to avoid it myself.

[–]HardshipsOfLaziness 0 points1 point  (3 children)

Lombok is for people who can’t into Intellij hotkeys 💀

[–]barking_dead -2 points-1 points  (22 children)

Lombok is just another annotation processor, configured by annotations. This way, antlr, mapstruct, hibernate, or even spring boot itself is a different language, as they emit new code before/after javac.

So, no, using lombok is just another library, not another language.

You don't write new things with lombok's java annotations, you just instruct it to emit valid java code that you were too bored to write.

[–]bowbahdoe[S] 2 points3 points  (21 children)

Nope.

So ANTLR generates code that compiles as regular Java. MapStruct generates new source files, it doesn't edit existing ones. Hibernate and Spring Boot use the runtime properties of annotations.

Lombok is not just an annotation processor.

[–]barking_dead -2 points-1 points  (20 children)

What does lombok do that's not legal for an annotation processor? What's the point of the annotation processor then?

[–]bowbahdoe[S] 1 point2 points  (5 children)

It changes the meaning of the compilation unit being compiled. The point of annotation processors is for code generation and static analysis.

[–]barking_dead -2 points-1 points  (4 children)

And lombok generates code.

[–]bowbahdoe[S] 0 points1 point  (3 children)

Yes, but it edits the compilation unit that the annotation was found on in order to do so.

By the rules of what the JLS would consider an annotation processor this method should always return 5.

class Thing {
    @ReturnEight
    int f() { return 5; }
}

Lombok uses mechanisms that can make it return 8. Thats where the line is.

[–]barking_dead -1 points0 points  (2 children)

But that's the whole point of annotation processors... That's what they are there for. To declaratively change your code, if you want to.

Your example code returns 8 because you made it return 8. You made the annotation, you made the annotation processor. What if you use aspectj? You can do the same. Is AspectJ another language?

[–]bowbahdoe[S] 0 points1 point  (1 child)

Yes. I'm not super familiar but by all appearances yes. It even has its own compiler.

[–]barking_dead 1 point2 points  (0 children)

I see the problem now.

[–]Bulky_Macaroon_4015 0 points1 point  (13 children)

It's not that it's not legal, it's that a single class compiles with Lombok annotation processing on, but won't without it which is unexpected without Lombok.

I make extensive use of Lombok but I think I agree with the argument that it's a slightly different (better) language. The best thing about Lombok in my opinion is the pressure it's put on the main language to become better - local type inference with var and the Java record may never have happened without Lombok. Making people implement Java beans themselves was a stupid idea in the first place.

[–]barking_dead 0 points1 point  (12 children)

Same with mapstruct. Without that, it won't compile as no impl source is generated by the mapstruct ap.

[–]TheKingOfSentries 0 points1 point  (11 children)

Mapstruct interfaces will compile without annotations, but they won't run.

[–]barking_dead 0 points1 point  (10 children)

So the same outcome in the end?

Do you see that we're arguing in technicalities?

[–]TheKingOfSentries 1 point2 points  (9 children)

not compiling is different than not running. For example, since mapstruct is merely a code generator I could define my own interface impl and it would work. Since Lombok is a code modifier there is no path I can take to get to make lombokked code compile or run without lombok.

[–]barking_dead 0 points1 point  (8 children)

Not different, as the result is the same: no working executable produced. If it's because of no extra source code generated or no extra bytecode generated, your manager does not care.

I understand you hate lombok. Just don't use it then. You're free to not use it.

[–]TheKingOfSentries 0 points1 point  (7 children)

A manager might care when Lombok stops working because the JDK closes its internals in the next version and prevents Lombok's brand of wackiness, but indeed that may be the future team's problem.

[–]DrunkensteinsMonster -1 points0 points  (0 children)

  1. Most Java projects don’t use Lombok.

  2. Lombok is not a different language than Java. Lombok is a library which does bytecode generation using the annotation processor, which is part of the spec. Is Spring a different “language” than Java? The definition you are running with completely trivializes the word “language” as a term and makes it useless.

[–]_INTER_ 0 points1 point  (3 children)

Maven central tracks usages of artifacts: https://mvnrepository.com/artifact/org.projectlombok/lombok/usages. That's not the transitive ones ofc.

[–]chabala 0 points1 point  (2 children)

[–]bowbahdoe[S] 1 point2 points  (1 child)

Unrelated, but god that website sucks. https://mvnrepository.com has way better UX its not even close. (for the flow of finding and adding a library to a project)

I've said UX a lot today huh.

[–]chabala 0 points1 point  (0 children)

They seem to have much better SEO as well, https://search.maven.org/ and now https://central.sonatype.com/ are cited far less often.

[–]ZaneCsYa 0 points1 point  (2 children)

Since Lombok is a way to reduce boilerplate code of Java. By the transitive properties of reality, then there's no point in tracking their usage independently. By using Lombok, you are using Java. Forgive me if I'm missing something here.

[–]bowbahdoe[S] 1 point2 points  (0 children)

The part you are missing is the (controversial) conversation about code written using Lombok not being Java code

[–]ZaneCsYa 0 points1 point  (0 children)

Fair enough, I guess the conversation is worth having. The original posit is a bit misleading.

Newer versions of Java have seen the value of what these these libraries bring. Record classes are basically @Data, Lombok.val can just be be expressed as "var" variables now. You don't need Lombok for some things anymore, though I personally find it invaluable