Live data from Hacker News

Lombok makes Java cool again

bytes.grubhub.com

161–170 of 239 posts

Re: Lombok makes Java cool again

#161
post #86

Earlier quoted context omitted.

"ML based languages really are an order of magnitude productivity boost." Is this still true when you consider available libraries, performance, concurrency, build and dependency tools, development environments, and deployment options?

I'd say it depends on which ML derivative you're talking about. I've found F# to be pretty good in all of the areas you mentioned. Although not enough to literally provide an order or magnitude boost like the post you were replying to suggested. I think people use "order of magnitude" a little too freely. Developing with Java (and to a lesser extent, C#) feels slower than with F#, but not 10 times slower.

I was not exaggerating, although you would not see the same improvements for all applications. The big win for me is do notation (or computation expressions). I hate to think how I would even write complex async code without it. If I was only writing something linear then Java wouldnt be so bad.

Re: Lombok makes Java cool again

#162
post #133

Earlier quoted context omitted.

I see the opposite. I see an industry all too willing to throw away years of hard earned knowledge, experience and purpose built tools in order to chase the shiny tools the popular kids are using. New tooling often follows a commom cycle of being light weight because they ditched the stuff that looked unecessary. Then slowly a whole ecosystem of plugins and libraries springs up to rebuild the missing tools. Like the…

> an industry all too willing to throw away years of hard earned knowledge, experience and purpose built tools in order to chase the shiny tools the popular kids are using. Why do you think people in the industry are doing this? There must be multiple factors behind this.

New products, languages are products as well, help sell conferences, consulting, books, trainings, libraries, IDEs....

Naturally it only works in new markets, because for existing products the market is already saturated.

Also some kind of improvements are just impossible in existing languages either due the language semantics and libraries, or community resistance.

Re: Lombok makes Java cool again

#164

Reading this just reminds me of all the terrible things about Java. The lack of reasonable default string representations, comparison and hashing methods, etc. are all glaring mistakes in the language design that have wasted huge amounts of time for millions of programmers. It's as though Java programmers are so deep in the grips of Stockholm Syndrome that ordinary, sensible behaviour seems amazing and "cool". This i…

> This is similar to the situation with design patterns. When design patterns came along, Java folks talked about them as though they were a wonderful new invention.

They are/were a bit over-hyped and sometimes overused inside the Java community, that's true.

> But they only exist because Java is so clumsy that it needed crutches to do things that had been easy and natural in other languages for years;

Sure, some design patterns work around language deficiencies or are that commonly used to justify including them into the language. Java sadly did not do this enough in the past, that's right. But if you look through the list of design patters only a minority fall into this category.

> someone merely came along and gave the crutches names.

That's basically the whole point of design patterns. It's assigning a name to things already widely used to improve communication between developers and to provide learners a point to look up a concept.

Re: Lombok makes Java cool again

#165

Earlier quoted context omitted.

I liked to refer to the genre as MOP -- Magic Oriented Programming. Every ecosystem I've seen go down that route ends up bailing out. A good example of this would be Apple's Cocoa Bindings [1] on macOS that were killed with fire when the iOS APIs were defined, and KVO [2] which is flat out rejected at every company I've ever worked. On the other hand, when built into the language, this kind of explicit but automatic…

Rails would be the opposite example. Magic all the way down and the ecosystem is not even contemplating the idea of bailing on it.

Good point!

Re: Lombok makes Java cool again

#166

It’s ok to let languages die; we’re just barely scraping out of the infancy of programming. Languages like Java and C++ which have carried us a long way need to evolve into new and better languages that incorporate lessons learned and the next wave of research. We also know from Google’s paper on software practices that software naturally gets rewritten over time, at a cadence that makes it acceptable to switch langu…

Only companies like Google can afford to rewrite everything every few years.

Re: Lombok makes Java cool again

#167
post #82

Earlier quoted context omitted.

The IDE support is pretty good these days, as least in IntelliJ.

Intellij still can't figure out how to handle implicits. At this point i have an intuition about the errors that idea reports as errors but actually aren't'.

Are you using the latest version of IntelliJ ?

Because it does a pretty good job with implicits now: https://blog.jetbrains.com/scala/2018/07/25/intellij-scala-p...

Re: Lombok makes Java cool again

#168
post #159
post #3

Lombok is a useful crutch if you're writing lots of Java code on a day to day basis. However, given how easy it is to use Kotlin alongside Java I would question whether Lombok is the right solution to the problem. Kotlin has data classes which auto generate sensible 'toString' and 'hashCode' methods which is a massive time saver. Really, if you are considering introducing Kotlin to a Java project I'd recommend you ju…

Kotlin has not flawless integration and some attention is required when writing libraries for Java consumption. Additionally the JVM wasn't enough for JetBrains and code written for multi-platform has slightly different semantics (see Kotlin/Native and immutable data). Kotlin is a good alternative on Android due to a frozen Java 8. Against Java 12 not so much. It is very hard to displace platform languages when other…

I would argue that Kotlin brings massive benefits over Java 12:

  * Excellent null safety enforced by the type system
  * Data classes reduce boilerplate and bug sources
  * Extension methods
  * Declaration site variance removes a lot of the ? extends T
  * Everything being an expression (if, switch/when) is powerful 
  * Smart casts are useful, especially when combined with subtypes and when (switch)
  * Removal of checked exceptions
  * Inline functions, a good way to work around runtime type erasure
  * Properties, no more getX or setX
None of these are the killer reason to go over to Kotlin or another JVM language, but all combined they make building software much more efficient. Java could get all of these, but they've tried to increase feature delivery speed multiple times by adjusting release schedule and failed so far.

Re: Lombok makes Java cool again

#169

Earlier quoted context omitted.

This is similar to saying that since error codes are ignored by most developers, functions shouldn't bother returning them at all. Error conditions captured in the type system are a vital part of making code robust. The fact that some developers don't know how to properly handle these error cases doesn't change anything to the soundness of checked exceptions.

> This is similar to saying that since error codes are ignored by most developers, functions shouldn't bother returning them at all. It's not like saying they shouldn't return them (unchecked exceptions exist), it's like saying they shouldn't be forced to check the error code or declare that they will return that error code themselves. Checked exceptions aren't sound when in practice the same ones are reused to mean…

Checked exceptions are the compiler forcing the developer to consider error cases.

What's not to like about that?

Contrast with all the other approaches (runtime exceptions, return codes, Either/Result, etc...) where the developer can happily ignore errors, the code will compile, and then crash at runtime.

Re: Lombok makes Java cool again

#170

Earlier quoted context omitted.

I liked to refer to the genre as MOP -- Magic Oriented Programming. Every ecosystem I've seen go down that route ends up bailing out. A good example of this would be Apple's Cocoa Bindings [1] on macOS that were killed with fire when the iOS APIs were defined, and KVO [2] which is flat out rejected at every company I've ever worked. On the other hand, when built into the language, this kind of explicit but automatic…

Rails would be the opposite example. Magic all the way down and the ecosystem is not even contemplating the idea of bailing on it.

Yes, but as a programmer when I'd start working on a new project, I would call it a Rails project, I've never heard of a Lombok project.

Sure, I've seen Spring/J2EE projects that used Lombok... some 10 years ago, but the idea seemed to have died down, maybe it's my own bubble.

Automagic is ok for a specific type of problem (Rails for webaps?), Lombok however reminds me a bit of the promises of AOP which failed to gain traction outside frameworks.

There are other highly opinionated frameworks/stacks that have mixed adoption in the java world -- jhipster seemed to gain some traction, but people seem to just use bare spring boot nowadays(which is quite opinionated)

I don't have absolutely anything against small projects, I'd love to work more on smaller projects, but 18000 lines of generated code is NOTHING, try to convince a medium team to use Lombok, you'll very soon end up with people loving or hating it, removing it for debugging purposes, creating their own generators and very soon it's a real mess. But all that is just my experience, I'm not trying to dismiss Lombok or any approach, if it works for you, great!

Post reply on HN