News for hackers. Stuff that matters.
Re:Kotlin Features I miss most in Java by stickfigure on Monday October 30, 2017 @02:31AM (#15583419)
I was going to write something similar. My takeaway from the article is that Kotlin is perhaps a very minor improvement over Java + Lombok + some functional libraries like Vavr.

This is actually my biggest complaint about Kotlin; it doesn't bring much to the table that is very new. If I'm going to move on from Java I want something more exciting like Ceylon's union & intersection types (which I get to use in... Typescript).

Re:Kotlin Features I miss most in Java by s4vi0r on Monday October 30, 2017 @05:32AM (#15583860)
As a non-Java dev, Lombok seems like the kind of thing that could only be tolerated by Stockholm syndrome java devs :/

I mean, it's a clever solution and the site/documentation is great. But tossing around annotations everywhere feels hacky as hell, not to mention that it only works with IDEs. I'm sure the combination you mentioned approaches Kotlin in terms of features and QoL improvements, but it's just so much nicer to have these things built into the language. Plus, Lombok is mostly constrained to boilerplate reduction - Kotlin may not be as "crazy" as Scala, but it still has some really nice modern features that java doesn't have/can't have/won't have for a long time.

Re:Kotlin Features I miss most in Java by stickfigure on Monday October 30, 2017 @12:57PM (#15586665)
As a polyglot, I don't understand your problem with annotations. These really aren't different:

    @Getter @Setter String foo;

    attr_accessor :foo
It's unfortunate that Java chose the silly capitalization convention for properties instead of something more structured like C#'s get/set, but that's really an aesthetic complaint.
Re:Kotlin Features I miss most in Java by 59nadir on Monday October 30, 2017 @08:32AM (#15584492)
I think this is the case with most JVM languages, to be honest. As someone who has done some Java but would never do it willingly as part of a hobby project or the like I think Kotlin and pretty much every other JVM language is a huge step up from Java.

When you're already knee deep in it I suppose you're bound to have a less enticing reason to use the other languages.

That being said, I don't see how you can look at the feature list of Kotlin and play around with it without seeing how it's obviously a much better language.

Re:Kotlin Features I miss most in Java by mschulze on Monday October 30, 2017 @06:01AM (#15583950)
> ...not to mention that it only works with IDEs.

That's not true. Lombok is an annotation preprocessor. That means it is running with javac which is independent of any build tools or IDEs. As long as it is on the classpath when compiling (-cp flag of javac) it works.

Of course for code completion you need an editor that is aware of Lombok / uses the compiled bytecode for that.

Re:Kotlin Features I miss most in Java by hasenj on Monday October 30, 2017 @04:47AM (#15583731)
There's rarely a need for a language with anything "new".

There's a strong need for a language that brings the best ideas recently developed and puts them together in a new language that does not have baggage from the past, (e.g. D).

I've never used Lombok or any other code generator with Java.

I think the important features of Kotlin are:

- Null checking

- Proper lambda/function types

- Not everything has to be a class

- You can specify parameter name when passing to functions: specially useful when constructing objects.

- Simplified constructors (member fields can be specified in the argument list).

These were some of my biggest pet peeves with Java.

That, and the weird stream APIs.