News for hackers. Stuff that matters.
Re:Kotlin: A Language with a Bright Future by pmelendez on Monday November 20, 2017 @10:05AM (#15740340)
Honest question. I have been checking Kotlin since a while but haven't found a compelling case for me to start using it. All the features I have seen so far are syntactic sugar.

Even the article quote something around those lines: “The syntax for Kotlin, like Apple’s Swift, is clean and modern. The reaction amongst developers learning Kotlin is not dissimilar to the initial experiences with Ruby years ago. The syntax is so intuitively designed that even without any previous exposure it’s almost possible to guess it.”

The question would be: Am I missing something? Is syntax the only reason that makes people excited about it? or are there any new abstractions/ideas that are exclusive for Kotlin?

Re:Kotlin: A Language with a Bright Future by lmm on Monday November 20, 2017 @10:20AM (#15740465)
To have a clean/nice/familiar syntax in a language with a semi-decent type system is actually a pretty big deal. What're the other options? Java and C# are pretty cumbersome, Haskell and OCaml (and to a certain extent F# and Rust) look weird, Swift/C#/F# are to a certain extent tied to proprietary platforms, and while Scala actually has a nice core syntax the culture of its libraries tended to hide that away under a pile of sigils.
Re:Kotlin: A Language with a Bright Future by pron on Monday November 20, 2017 @10:31AM (#15740558)
What feels cumbersome to some may not feel cumbersome to others, or they may not care as much about this, because, for example, they can feel that concrete code is less important than design, and considering that a minor reduction (at best) in the time spent working with code translates to negligible (or even negative) overall contribution to the project, and may certainly not justify sacrificing the many other conveniences that come with using a hugely popular, familiar and well-tooled language.
Re:Kotlin: A Language with a Bright Future by kumarvvr on Monday November 20, 2017 @10:57AM (#15740790)
I can't really pinpoint it, but somehow C# dosen't seem so cumbersome as Java. Perhaps it's the libraries.
Re:Kotlin: A Language with a Bright Future by wvenable on Monday November 20, 2017 @01:04PM (#15741790)
C# isn't as cumbersome as Java.
Re:Kotlin: A Language with a Bright Future by jarym on Monday November 20, 2017 @10:10AM (#15740379)
Depends on your definition of syntactic sugar - for instance, the coroutines stuff is very intuitive and makes code far more readable and easier to work with. It all compiles down to stuff that a Java decompiler will be able to read back to Java.

But that's just one example and a subjective one at that. Not everyone will feel the same way and for those who don't there's no compelling reason to 'start using Kotlin' - if what you have works then stick with it.

There's also Kotlin native and Kotlin JS - allowing Kotlin code to be compiled to native binaries as well as to javascript is pretty compelling and will (imo) pay dividends. Both are still very much in development though.

Re:Kotlin: A Language with a Bright Future by mateuszf on Monday November 20, 2017 @10:29AM (#15740546)
> Am I missing something? Is syntax the only reason that makes people excited about it?

That with combination of precise refactorings, unlike in case or ruby. And without unnecessary complexity of scala.

Re:Kotlin: A Language with a Bright Future by jimbokun on Monday November 20, 2017 @11:09AM (#15740914)
"All the features I have seen so far are syntactic sugar."

Programming languages are basically nothing but syntactic sugar over machine code.

Re:Kotlin: A Language with a Bright Future by pmelendez on Monday November 20, 2017 @11:47AM (#15741224)
That's a bit of an oversimplification. I would argue that anonymous functions, first-order functions, lambdas, macros that modify ASTs are not syntactic sugar but features of a language that contribute with the expression power.
Re:Kotlin: A Language with a Bright Future by pron on Monday November 20, 2017 @10:25AM (#15740508)
This syntactic sugar makes a big difference for some people, and not so big for others. It's largely an aesthetic choice.
Re:Kotlin: A Language with a Bright Future by taesis on Monday November 20, 2017 @10:26AM (#15740516)
AFAIK, it's popular on Android because it provides e.g. Java 8 stream-like functionality without needing support for that baked into ART, which is something. Additionally, it supports compilation to Javascript [3] and early support for JVM-less execution ("native") [4]. No new abstractions or ideas, though; the language designers were aiming to make something that formalized current best practices, not lay down new ones.

Beyond that, it's nothing that you couldn't cobble together without the standard Guava + Commons + Lombok + Quasar/EASync etc. libraries and plugins that you'd use on every project written in Java, as well as that terseness you mentioned that makes people excited (see Kotlin data classes [1] vs Lombok data classes [2], if/try returns values and destructuring [5], coroutine support for lightweight threading and generators [6], null safety w/o optionals and smart casting, etc. [7]).

In my opinion, it's hard to know what value those features provide without actually trying them out yourself. If you want to be certain that you're not missing something, I'd suggest writing up a little script to try out some of its features.

edit: Just noticed the other responses on this thread. It's also very useful for starting fights with Scala developers, apparently.

[1]: https://kotlinlang.org/docs/reference/data-classes.html

[2]: https://projectlombok.org/features/Data

[3]: https://kotlinlang.org/docs/tutorials/javascript/kotlin-to-j...

[4]: https://kotlinlang.org/docs/reference/native-overview.html

[5]: https://kotlinlang.org/docs/reference/control-flow.html

[6]: https://kotlinlang.org/docs/reference/coroutines.html

[7]: https://kotlinlang.org/docs/reference/null-safety.html

Re:Kotlin: A Language with a Bright Future by pankajdoharey on Monday November 20, 2017 @10:22AM (#15740473)
There is none, it is a bad copy of Scala, written by some people who didnt want to write Scala the way it is written and hence thought of inventing Scala again albeit a little differently.