News for hackers. Stuff that matters.
Re:Learn Kotlin in Y Minutes by jorgemf on Thursday May 18, 2017 @02:29PM (#14369769)
I like kotlin a lot, but suddenly there are a lot of articles in the front page about it. Kotlin isn't more cool because Google announced yesterday it is going to use it in Android. Kotlin is the same good language it was 2 days ago! (rant over)

If you want to learn kotlin go to the official docs and tutorial, they are as good as the language:

http://kotlinlang.org/docs/reference/

And you don't need to install anything as you can try it in the browser:

https://try.kotlinlang.org

Re:Learn Kotlin in Y Minutes by prlambert on Thursday May 18, 2017 @02:40PM (#14369854)
The language itself isn't 'more cool' or better, but the risk profile of adopting it has dropped dramatically. That makes it much more interesting.
Re:Learn Kotlin in Y Minutes by MyNameIsFred on Thursday May 18, 2017 @07:49PM (#14371993)
My team of consultants will write Android apps, and the customer takes ownership of the code base when we're done.

My wife would leave me if she knew how much I love Kotlin, but I could never use it for work projects because we just could not justify expecting random inheriting developers to know Kotlin and accept its legitimacy. That constraint lifted in an instant. It's a political thing, but it really matters.

Re:Learn Kotlin in Y Minutes by jorgemf on Thursday May 18, 2017 @02:48PM (#14369920)
There weren't any risk before apart form the kotlin plugin not working with beta versions of the gradle build plugin. Using kotlin in Android is like using a library, and you don't have official support from Google for all popular libraries used in Android.
Re:Learn Kotlin in Y Minutes by ajmurmann on Thursday May 18, 2017 @03:38PM (#14370380)
The risk was that you might end up with a code base that you cannot find developers that will work on it/maintain it in the future. The Android support should pretty much guarantee that there will be enough developers familiar with it in the future.
Re:Learn Kotlin in Y Minutes by jorgemf on Thursday May 18, 2017 @04:18PM (#14370739)
If you are an Android developer you should be aware of kotlin long time and and also tried and use it. Good Android developer knew kotlin before, now you will face more noise to find them.

It is like hiring something who doesn't know the most used libraries in Android. And the risk is exactly the same. The language is not difficult to learn, not much more than a mid-complex library.

Re:Learn Kotlin in Y Minutes by lghh on Thursday May 18, 2017 @04:43PM (#14370934)
But Kotlin was farrrrrrrrrr from a "most used library". The risk of an unsupported language being used is much, much greater than using an unsupported library. Libraries are non-trivial to remove from your code, but should not be tied to your code to the point that you will be required to completely rewrite your application like you would if you ran into issues with the language it's written in.
Re:Learn Kotlin in Y Minutes by jorgemf on Thursday May 18, 2017 @05:04PM (#14371075)
Say so to the people who is using RxJava or similar, whether they need to rewrite everything or not. In every program you need to take architectural decisions that affect how everything is build and a change on them could mean to rewrite everything. It can be a library or the programming language.

JetBrains was supporting kotlin for Android, the same people that build IntelliJ idea (the base of Android Studio). But who is supporting RxJava? Imagine that the react community wants to make a move that will harm Android devs, so they change all the Rx*, including RxJava.

Using kotlin wasn't a risk. Google said it will make it first class citizen, but do you really trust Google in the long term? They close products very quickly. I feel safer knowing that JetBrains is behind kotlin and not Google.

Re:Learn Kotlin in Y Minutes by CorpOverreach on Thursday May 18, 2017 @05:17PM (#14371178)
There are risks other than just not being able to build it.

If I have an app with a codebase in a language that very few people know, that's a risk. What if my main developer leaves and I need to find someone else to continue working on the code base?

You can now bet that a lot of people will be picking up Kotlin as a result of the latest announcement.

Re:Learn Kotlin in Y Minutes by hn_throwaway_99 on Thursday May 18, 2017 @02:39PM (#14369845)
Official support still matters. There is some inherent risk whenever you go in a direction not explicitly supported by the owner of your platform, and now that risk is gone.
Re:Learn Kotlin in Y Minutes by jjoonathan on Thursday May 18, 2017 @02:42PM (#14369869)
Not only does official support matter, it matters much more than whether or not the language is good. I keep learning that lesson again and again in the hard, painful way.
Re:Learn Kotlin in Y Minutes by TJ-14 on Thursday May 18, 2017 @03:02PM (#14370064)
As a new developer I'd like to hear more about why this is?
Re:Learn Kotlin in Y Minutes by smitherfield on Thursday May 18, 2017 @04:39PM (#14370896)
If a language or tool is officially supported, then that means the project maintainers (Google, in this case) promise to support its use with official documentation, priority bug fixes (for example, if an Android update breaks your app which is written in Kotlin and uses only public, non-deprecated APIs, Google will consider it just as high-priority a bug as if it were written in Java), and first-class access to new APIs as soon as they're created.
Re:Learn Kotlin in Y Minutes by jorgemf on Thursday May 18, 2017 @05:13PM (#14371141)
JetBrains is doing this, not Google. Google is only going to collaborate with JetBrains to help with the Android support.

> Android update breaks your app which is written in Kotlin

then it also breaks the same app written in java. Because the good thing about kotlin is that it is transparent, it generates bytecode as java does. So from the point of view of the platform there is no difference between kotlin and java.

> first-class access to new APIs as soon as they're created.

This makes me think you don't know how kotlin works. You can mix java and kotlin files in the same app and call methods from one to the other without problems.

Re:Learn Kotlin in Y Minutes by smitherfield on Thursday May 18, 2017 @05:42PM (#14371361)
> JetBrains is doing this, not Google. Google is only going to collaborate with JetBrains to help with the Android support.

Jetbrains isn't doing anything differently with Kotlin from what they've been doing for the past 7 years. The headline here is "Google officially supports Kotlin on Android," and that is what has HN so excited. Regardless of how the work involved in supporting Kotlin on Android is split, this represents a guarantee that did not exist before. If all Jetbrains employees were abducted by aliens tomorrow, Google will now still have committed to first-class support of Kotlin through the next couple of major versions of Android.

> then it also breaks the same app written in java. Because the good thing about kotlin is that it is transparent, it generates bytecode as java does. So from the point of view of the platform there is no difference between kotlin and java.

They share the same compilation target, not the same semantics and idioms. Just because Go, Haskell, C and LuaJIT all target x86 assembly does not mean a Linux kernel update won't break a properly-written program in one of those languages but not the others. This in fact happens all the time.

> This makes me think you don't know how kotlin works. You can mix java and kotlin files in the same app and call methods from one to the other without problems.

I was answering their question generically. But first-class official support means that, for example, if Google adds a new feature to the [Java] Android Runtime, they will, where relevant, now ensure it's implemented in the official Android Kotlin compiler as well as the Java compiler.

Re:Learn Kotlin in Y Minutes by jorgemf on Friday May 19, 2017 @10:37AM (#14376034)
> "Google officially supports Kotlin on Android,"

It is JetBrains who support it, Google is only going to collaborate with them to help them out and keep the support up to date.

You don't have any idea about kotlin, the API is exactly the same. It is the Java API for both Java and Kotlin. The support is more related with the tooling, no with the API.

Go, Haskell and C are completely different things. Java and Kotlin compile to bytecode and the JVM runs the bytecode. Both uses the same API in the same language (the bytecode). You only have to guarantee they target the same bytecode version, which is something Google cannot do anything about, it is JetBrains who decide. This is not like Java and C in Android. C has its own API which calls the Java API. Kotlin uses the Java API, and the JVM in the Android device doesn't know if the app was written in Kotlin or Java.

P.S. Actually Android doesn't use the compiled bytecode directly as it make some modifications, but the idea still applies.

Re:Learn Kotlin in Y Minutes by jorgemf on Thursday May 18, 2017 @02:51PM (#14369946)
Out of curiosity, What was your bad experiences?
Re:Learn Kotlin in Y Minutes by jorgemf on Thursday May 18, 2017 @02:46PM (#14369896)
You can use kotlin for more things than just Android. And before it had official support from JetBrains (for Android among others). The way it works in Android doesn't make any difference with other popular libraries as retrolambda, picasso, dagger, etc. Those aren't supported by Google and still used in a lot of Android apps.

Google only said they are going to collaborate more with JetBrains, which in my mind it translates in "we, developers, are not going to have incompatibility issues between kotlin and beta versions of the gradle plugin". (I want to highlight the word beta, because with stable versions it was weird you have any issue with kotlin).

Re:Learn Kotlin in Y Minutes by city41 on Thursday May 18, 2017 @03:17PM (#14370203)
I don't think people are saying it's more cool, but the announcement sure made it more known. I'd never heard of it before the announcement (I don't do anything with the JVM these days, so I'm not up on it).
Re:Learn Kotlin in Y Minutes by copperx on Thursday May 18, 2017 @04:02PM (#14370623)
It IS cooler, because everything that Google touches becomes gold, according to HN.
Re:Learn Kotlin in Y Minutes by devopsproject on Thursday May 18, 2017 @04:17PM (#14370734)
google gets a ton of criticism here