Suggestion: Lombok

I think using lombok would be great, I heard that it wasn’t being used to help developers, by not having to install extra things to use Sponge, however they might have to install forge (you do with client mods)
And it’s not like lombok is difficult to install, you run the jar… job done (in most cases)
BungeeCord uses lombok, so why can’t sponge! :frowning:

All I really have to say is “why?”

I mean, sure, it pretties up the code just a little bit - but it doesn’t increase efficiency or add anything to the code. It’s just aesthetics and saving the need from typing getters and setters etc…

2 Likes

Agree with @jdersen

Also getters and setters could be generated by every good IDE.

1 Like

I don’t see how having it would cause a problem, like I said Bungee has it and works fine.

Just because it works fine, doesn’t mean it’s fine to work with. When I was making changes to Bungee, it caused me so many issues - Lombok’s good intentions hide a lot of code and can confuse developers trying to work on such code.

I’d be more for it if the @Getter/@Setter annotations worked more like properties in C# (so you can just access the property, rather than go through methods), but all it does is (invisibly) generate get/set/is methods (that last case caught me out so many times when using a @Getter on a boolean, expecting a getForgeSupported instead of isForgeSupported). It also really messed with my head when dealing with subclasses…

The @[blah]Constructor annotations can really catch you out too.

I guess Lombok is fine for creating data classes/POJOs, but for complex classes containing logic (like most Sponge classes), my opinion is that it only serves to confuse others, particually those new (and even those experienced) to development.

2 Likes

Discussed already:
https://github.com/SpongePowered/Meta/issues/13

Are you saying aesthetics and syntactic sugar are needless? If that’s the case then why can’t we all code in C? Who needs that newfangled nonsense that higher languages offer anyway?

When, and where, did I say that it is needless? I asked, simply, “why?” Why, exactly, is Lombok necessary? Not only does it prettify the code, sure, but it also makes it confusing to read sometimes and it doesn’t always use methods that the developer is expecting.

Anyway, who am I to say “no”? If you want it, use it. I really don’t care.

I’ve used Lombok a fair amount but (1) we don’t have many data classes (2) you get a lot of people complaining that they get errors in their IDE.

Did you take a look at this?

Edit: Just saw @IDragonfire posted the same link.