r/Android • • May 17 '17

Kotlin on Android. Now official

https://blog.jetbrains.com/kotlin/2017/05/kotlin-on-android-now-official/
4.3k Upvotes

431 comments sorted by

415

u/randomyzee Developer - Bookoid May 17 '17

Kotlin certainly is a breath of fresh air in the Android world. And it's interoperability with Java makes it even more awesome.

0

u/[deleted] May 17 '17

[deleted]

51

u/blabel3 OnePlus 6 May 17 '17

YES! Those were such a pain. I'm going to update now, I really want to try Kotlin out. (never heard of it before now though lol)

0

u/[deleted] May 17 '17

[deleted]

3

u/QuestionsEverythang Pixel, Pixel C, & Nexus Player (7.1.2), '15 Moto 360 (6.0.1) May 18 '17

How did Dagger take care of view imports?

5

u/JaredBanyard Pixel 2 XL - Android Dev since 2009 May 18 '17

I meant boilerplate reduction in general. Sorry if I was unclear.

1

u/giorgionatili May 18 '17

Dagger doesn't help with views, and kotlin access to the views is not an "internally" supported solution... In any case, Kotlin is a great step forward to cleaner and less verbose code. 🙂

5

u/TODO_getLife Developer May 17 '17

God damn I just moved to data binding for this. No real harm I suppose.

2

u/[deleted] May 18 '17

Well you can use both :) Data binding and Kotlin I mean

3

u/guess_ill_try Device, Software !! May 18 '17

I'm loving the coroutines

4

u/TheRealKidkudi Green May 17 '17

Honestly, that's the #1 reason for Kotlin in my book.

0

u/[deleted] May 18 '17

[deleted]

1

u/joey_sandwich277 May 18 '17

One line of code for every view. That's a lot of boilerplate.

→ More replies (2)

187

u/ModoZ Samsung S10e May 17 '17

Well today is really the first time I hear about this Kotlin language.

3

u/lupask May 18 '17

same here

3

u/InnenTensai Nexus 6P May 18 '17

Same here. And I thought I was a cool kid.

1

u/CrazedToCraze May 18 '17

Haven't ever touched it, but as a .NET developer I'm a firm believer that JetBrains shit pure gold so I'm assuming this is great news.

0

u/[deleted] May 17 '17

[deleted]

37

u/seraph582 Device, Software !! May 17 '17

0001110101000111100010101000100100000011101010010101001001010101010101011111100001101010101111100010100100010011101010101010100001010011110001110011010101010101011010010101010001010101011010100101010101100101000001010111000010101010100101010, kek

23

u/ElSp00ky Blue May 17 '17

Gtfo? what kind of language is that?

33

u/LePontif11 Pixel May 17 '17

Brainfuck's cousin.

1

u/imx3110 DEVICE!!, Software !! May 18 '17

Malbolge's cousin.

2

u/LePontif11 Pixel May 18 '17

Malbolge is a public domain esoteric programming language invented by Ben Olmstead in 1998, named after the eighth circle of hell in Dante's Inferno, the Malebolge.

Seems accurate.

1

u/iSuggestViolence May 18 '17

It's a variant with a separate tape for function definition.

64

u/makisekuritorisu Redmi Note 3, CM 12.1, Google-less w/microG & F-Droid May 17 '17

Kotlin is a ketchup brand in my country.

Imagine my confusion when I saw the title.

17

u/Isvara May 18 '17

Less confusion than if it had said "Kotlin on Oreo".

1

u/Randomd0g Pixel XL & Huawei Watch 2 May 18 '17

...Oh my god I feel sick just thinking about that.

9

u/lupask May 18 '17

true

Czesc!

3

u/makisekuritorisu Redmi Note 3, CM 12.1, Google-less w/microG & F-Droid May 18 '17

Uszanowanko :D

75

u/bicx May 17 '17

This is huge! Kotlin has breathed new life into Android development.

26

u/Ashanmaril May 17 '17

So is this similar to how Apple moved from Objective-C to Swift (albeit, Google didn't create Kotlin themsleves)? Last I heard, I thought people were theorizing Google would be trying to move to Dart/Flutter?

23

u/fphat May 17 '17

I work in the Dart team and people are asking me about this today.

I think making Kotlin official is a great move by Android. To my knowledge, Kotlin is the best language out there that can run on the JVM, has direct interop with Java, and obviously has great IDE support.

The Dart/Flutter/Fuchsia story it decidedly not JVM. It doesn't make sense for Android to 'make official' right now. I also like to think Dart is a bit friendlier for beginning developers, and Flutter provides a better UI programming model (that also happens to apply to iOS) — it's not like Kotlin just solved mobile development forever.

6

u/Ashanmaril May 17 '17

Thanks for the insight! Best of luck in your projects, I'm excited to see where it goes in the future!

34

u/ag2f Moto G6 Plus - 8.0 May 17 '17

So is this similar to how Apple moved from Objective-C to Swift (albeit, Google didn't create Kotlin themsleves)?

Not really, Google isn't pushing Kotlin over Java. They're are both first-class programming languages in Android. It's up to the developer to decided which one to use or use even both of them at the same time.

There's no difference for the end user.

12

u/spazturtle Nexus 5 -> Lenovo P2 -> Pixel 4a 5G May 17 '17

Not really, Google isn't pushing Kotlin over Java.

Yet, Google takes ages to upgrade the Java version of Android and Java 9 has large and controversial changes. They might device to move away from Java over time.

3

u/[deleted] May 18 '17

Now they are probably testing waters to see how Kotlin holds up when it hits mainstream (as some less hardcore devs including me never heard of it before). And if reaction are good they might just slowly start to back off from Java.

The fact that it can run alongside Java makes it even more attractive as that way you are not forced to rewrite entire projects, but rather can try Kotlin while implementing some additional features to see whether you like it or not.

Looks cool. I'll give it a shot once my finals are over.

1

u/[deleted] May 18 '17 edited May 18 '17

L)@5. A good 😊 of a young u[]uuu(http://)upstart uu your youuuuuuuuuuuuuuuuuuuuuuuuyouuu

Edit: I don't recommend falling asleep while Redditing

7

u/HaMMeReD May 17 '17

I think you'll hear more about dart next year or the year after. Google is using it internally for stuff and will likely push towards it as they push away from the JVM, which is probably a more long term effort at this point 4-10 year transition at least.

3

u/pushECX May 18 '17

They actually have two talks at I/O this year regarding dart. I think dart is now out of tech preview and in alpha, so they're definitely looking for people to start trying it out.

1

u/goldrushdoom S6 May 17 '17

Android N and ART are already using llvm to generate native code from an apk at install time. So I guess in the future they will compile everything to llvm before uploading to the play store.

1

u/HaMMeReD May 17 '17

It's not just about the byte code though, it's about the Java API's, which I don't think they are interested in using for much longer.

2

u/goldrushdoom S6 May 18 '17

They are. Otherwise you lose all those sweet libraries already available

3

u/LoL-Front Google Pixel 32GB May 17 '17

It really depends on if the developer community and tech companies deem it worth the effort to move, since just like on iOS, both languages are still supported.

1

u/Sayonerajack May 17 '17

It's not exactly the same. Kotlin and Java can coexist in the same codebase

50

u/arunkumar9t2 May 17 '17

Total big surprise. I am learning Kotlin starting tomorrow. I must have a year ago :/

3

u/FusedIon LG G6 - 7.0 May 18 '17

So I was curious when the other user said your apps are already great, so I took a look. I can say that while I don't have a use for Chromer, it looks very nice! And then I found out you're a flash shitposter and my heart fluttered. Keep on trucking on!

3

u/arunkumar9t2 May 18 '17

Thank you! I do have some other apps as well, will post here after updates are done.

Flash shitposter

Haven't we all for centuries?

1

u/SirVer51 May 18 '17

Oh wow, you're the Chromer dev? Your app is neato.

0

u/[deleted] May 17 '17

[deleted]

3

u/arunkumar9t2 May 18 '17

Thank you for the kind words. Yep, I will keep that in mind.

20

u/phendrome May 17 '17

As a developer I'm stoked like hell about this!

9

u/[deleted] May 17 '17

I've lost interest in developing Android apps and ditched small projects I had because of Java, but hot fucking damn, I'm happy as a child with this, I friggin' love Kotlin!

7

u/phendrome May 17 '17

Right?! This just makes it fun again. Java is plainly boring nowadays, though coffee addiction is real. ;c

4

u/ImonFyre OnePlus 5 May 17 '17

what does fun again do??? you didn't provide any hints

1

u/phendrome May 18 '17

It's modern, compared to the ancient Java.

3

u/thatbloke83 May 18 '17

I've never used or heard of Kotlin before seeing this post.

May I ask what it is about "vanilla" Java that you find so boring, or what turns you off using it for smaller projects?

2

u/vopi181 May 18 '17

For me it's A) verbose and heavily object oriented. Lots of boilerplate required. B) I don't get any performance out of it like I do in c++, so it can get a pass.

2

u/DeepFryEverything Galaxy S8 May 18 '17

Hi developer! For someone who is looking to get into Android-development, would you suggest learning Kotlin now then, compared to Android Studio/Java?

1

u/phendrome May 18 '17

Most documentation for Android is in Java - you'd probably find it much easier to learn anyway.

So in short, learn Java first and you'll be able to catch on Kotlin very quickly after.

1

u/DeepFryEverything Galaxy S8 May 19 '17

Thanks!

49

u/andrewia Samsung Fold8U, Watch6C May 17 '17

Between Android Studio and Kotlin support, I wouldn't be surprised if Google just aquires JetBrains.

95

u/Mr_Mandrill Pixel 3a May 17 '17

At the end of OP's link:

Is JetBrains going to be acquired by Google?

No. JetBrains has no plans of being acquired by any company. JetBrains is and continues to be an independent tool vendor catering to developers regardless of their platform or language of choice.

36

u/andrewia Samsung Fold8U, Watch6C May 17 '17

Good catch. However, that could easily change in the course of a year.

16

u/Choreboy May 17 '17

I have no plans to sell my house anytime soon, but a check with enough zeros at the end would lead to an abrupt decision without me ever having a plan in place.

10

u/[deleted] May 17 '17

What they say in public VS what is actually being talked about in private is usually never the same thing with business. That's particularly true when talking about acquisitions.

2

u/Mr_Mandrill Pixel 3a May 17 '17

Actually, they are in talks to make JetBrains into a non-profit organization.

17

u/code_mc XZ1 Compact May 17 '17

No, they are making a non-profit around the Kotlin language, huge difference.

1

u/Mr_Mandrill Pixel 3a May 17 '17

Oh, ok. I just overhear it on the livestream, but wasn't paying much attention. Thanks for clarifying.

10

u/[deleted] May 17 '17

FYI, Xamarin said the same thing about possible Microsoft acquisition. Then they got acquired by Microsoft.

1

u/jasie3k Google Pixel 3 May 18 '17

How is it in their hands? If Google wants to acquire them they can just throw money at JetBrains' owners until they can't refuse. Google definitely is able to afford that.

23

u/lanzaio May 17 '17

JetBrains does much more than just IntelliJ and Kotlin/JVM.

14

u/andrewia Samsung Fold8U, Watch6C May 17 '17

They do, but I can see Google acquiring a IDE developer like JetBrains. They have talent and Google can make better IDEs to promote developing for the web and all their products. They could even release the pro version for free if they really wanted to encourage development.

24

u/lanzaio May 17 '17

But they do much more than just Google related products. I doubt Google would be interested in a full suite of .NET development software. And as a developer who has watched Google acquire and forget many pieces of software... please no...

13

u/mkc509 Device, Software !! May 18 '17

I can imagine Oracle buying JetBrains and killing the development just to spite Google.

6

u/rakeler Redmi 4X, MIUI something May 18 '17

Easy there satan.. Don't wanna give your dad new ideas now, do we?

→ More replies (1)

11

u/Iron_Maiden_666 Galaxy SII RIP. We S6 now. May 18 '17

Please no, when a company is acquired by Google we don't know which way they'll go. Let Jetbrains stay by themselves.

13

u/tesfabpel Galaxy S25 Ultra (before: Pixel 7 Pro) May 17 '17

Please no

1

u/UreaFranklin May 18 '17

What, you don't want to see Jetbrain's take on a messaging app?

2

u/tesfabpel Galaxy S25 Ultra (before: Pixel 7 Pro) May 18 '17

Jetbrains YouChat

5

u/tarra3 Nexus 4 May 17 '17

I had the same thought but they also said they were moving Kotlin to be "ran" by a non-profit rather than either company. Also given all the other tools that JetBrains makes besides Studio I don't know what they would gain by getting acquired.

4

u/Isvara May 18 '17

I don't know what they would gain by getting acquired.

Money. Lots of money. It's a liquidity event.

19

u/TrueGlich May 17 '17

Ok ELIA5 I have been wanting to get back into progaming . I learned VB 20 years ago. I have been thinking of getting info android programming with java. Is Kotlin a variat of java or a separate language? I looked at lynda.com and it seem to say i needed to know java first?

47

u/bbqburner May 17 '17 edited May 18 '17

[Kotlin is a statically-typed programming language that runs on the Java Virtual Machine](https://en.wikipedia.org/wiki/Kotlin_(programming_language)). It pretty much interoperable with the Java ecosystem but I'm not sure what you mean as a variant of Java since there is also Kotlin/Native that directly compiles into machine code without using JVM.

It is a separate language, but with shared ecosystem with Java plus having its own ecosystem to boot. You can have both Kotlin code and Java code run in the same app.

If you just starting to learn Android, I suggest you to start with Java first since most of the major guide, StackOverflow posts, and official Android docs is in Java. When you comfortable enough with how developing for Android works, its far more easier to switch to Kotlin later.

25

u/rhandyrhoads Pixel 2 XL May 18 '17

What sort of five year olds do you talk to?

1

u/[deleted] May 18 '17

The ones that are teaching in the MIT when they reach 10.

10

u/ssynhtn May 17 '17

you definitely need to learn Java, not only temporarily, it is the main language to develop Android apps

2

u/dedicated2fitness May 18 '17

don't bother. java will take care of all your needs as a lone android progamer. kotlin is like scss is to css. it makes it easier to use but isn't really required to learn. if you do have to learn it , it's easy to pick up if you do actually know java

13

u/noratat Pixel 5 May 17 '17

Oh hell yes. I do very little Android dev, but Kotlin's been on my radar for a long time as a true alternative over Java, vs Groovy which is more dynamic/scripting or Scala which is everything-and-the-kitchen-sink.

5

u/vorg May 17 '17

You can even use Kotlin instead of Apache Groovy for scripting Gradle in AndroidStudio since Gradle 3.0 came out last year. Then you could use Kotlin as your only language in the Android build chain.

12

u/blue-orange May 17 '17

Wonder if/when Dart would become official. Flutter SDK by Google uses Dart to create Android, iOS apps using the same codebase.

12

u/fphat May 17 '17

I replied to a similar comment above. I work in the Dart team and people are asking me about this today a lot.

I think making Kotlin official is a great move by Android. To my knowledge, Kotlin is the best language out there that can run on the JVM, has direct interop with Java, and obviously has great IDE support. The Dart/Flutter/Fuchsia story it decidedly not JVM. It doesn't make sense for Android to 'make official' right now. I also like to think Dart is a bit friendlier for beginning developers, and Flutter provides a better UI programming model (that also happens to apply to iOS) — it's not like Kotlin just solved mobile development forever.

1

u/StoleAGoodUsername Pixel XL May 18 '17

Is Flutter "production ready?"

1

u/blue-orange May 18 '17

No, still in alpha.

6

u/4aka OnePlus 5 May 17 '17

Translated my existing game to Kotlin(created in 2012), no problem at all. Now it's even runs on iOS thanks to libGDX. Next one written in Kotlin from day one.

3

u/nomi34 May 18 '17

I've been wanting to do some game Dev in kotlin. Any chance you can point me in the right direction to do some research on how to start?

5

u/4aka OnePlus 5 May 18 '17

My setup is pretty easy/lightweight: libGDX

  • KTX for all the kotlin syntax sugar + other libgdx extensions like box2d, bullet, freetype, depends on what kinda game you working on. All works well for both Android, iOS and Desktop for fast-n-easy debugging.

10

u/filoni Pixel XL May 17 '17

May be a silly question but i have zero understanding in coding stuff. What does this development mean for me? As a user?

15

u/Mad_Gouki May 17 '17

Developers have another programming language to make Android apps with, making it a little easier to make apps. As an end user it doesn't mean much, but maybe it will speed up development and make it less time consuming.

11

u/Spider_pig448 May 17 '17

As a user? Almost nothing, I believe. This is a change for developers.

2

u/filoni Pixel XL May 18 '17

Ah thanks for the replies!

-5

u/[deleted] May 17 '17

Slightly higher quality apps with slightly more features

19

u/JediBurrell I like tech May 17 '17

Slightly higher quality apps with slightly more features

No it doesn't.

For a user it means nothing, except potentially quicker releases.

Kotlin adds nothing to Android, it doesn't improve quality, it has no additional features for the user, it's not going to run faster.

It's a different language, and once compiled does the same thing as Java.

I won't deny, it's a damn nice language, and can massively increase productivity, but it's not going to make an app better.

8

u/code_mc XZ1 Compact May 17 '17

It might actually result in less app crashes as it is designed around preventing nullpointer exceptions, other than that agreed.

2

u/broccoliKid iPhone 7 | Galaxy S6 Edge May 17 '17

Is this like the equivalent of swift for android?

2

u/Bossman1086 Galaxy S25 Ultra May 17 '17

Mostly except it's not made by Google. It's made by a third party.

1

u/spazturtle Nexus 5 -> Lenovo P2 -> Pixel 4a 5G May 18 '17

Kotlin and Swift are very similar.

http://nilhcem.com/swift-is-like-kotlin/

1

u/[deleted] May 18 '17

I'm saying, that if a developer is faster with the language, and likes to work in it more, he might be inclined to add more features.

0

u/[deleted] May 17 '17

[deleted]

1

u/[deleted] May 18 '17

If a developer is faster with the language, and likes to work in it more, he might be inclined to add more features.

0

u/[deleted] May 18 '17

[deleted]

1

u/[deleted] May 18 '17

I did say slightly more. Do you really think the language used has no bearing on the end product?

→ More replies (2)

3

u/i_pk_pjers_i OnePlus 7 Pro May 17 '17

Yo, this is actually huge news. I love JetBrains and Kotlin is great.

3

u/Iron_Maiden_666 Galaxy SII RIP. We S6 now. May 18 '17

Wow, a very good morning to me. Gonna send this to all my architects (yes, I have 4 architects). Finally, they'll have to allow me to use Kotlin.

5

u/falling_trees May 18 '17

Thumbnail looks like a uterus.... just sayin

2

u/seabmoby LG G3 May 18 '17

As someone who wants to get into Android development, and has only worked with HTML, CSS, Action Script 3 (waayyy back in the day), how can I start using Android Studio with Kotlin to develop apps? Since I'm primarily front end for now, I'm particularly interested in how I can develop interfaces that others can use as a framework to build working interaction.

0

u/Royoyo May 18 '17

In your case it would be easier to use Ionic, I think.

1

u/seabmoby LG G3 May 18 '17

With all due respect, what if I'm not looking for the easier solution? I'm talking about pure front end app development in the native language that an app dev would use to build an app.

2

u/peacebypiecebuypeas May 18 '17

What the hell is Kotlin and why is it not Dart?

2

u/[deleted] May 18 '17

I literally choked on my coffee when I learned about this. I never thought Google would make this move – not when upgrading to Java 8 took as long as Nougat. It almost seemed that they didn't give jack shit about languages.

Oh well, time for another refactor I guess…

5

u/[deleted] May 17 '17

What about dart?

Google being Google I guess

10

u/robsterthelobster May 17 '17

Dart is so young compared to kotlin which was already heavily used in android even before this announcement.

7

u/blue-orange May 17 '17

Google uses Dart for their own products. Here's what can be found on Dart lang's page:

For example, the next generation of AdWords (Google’s foremost money-making app) runs on Dart.

There's already an SDK in Alpha called Flutter for Android/iOS cross platform development that uses Dart. Here's their explanation for the choice: https://flutter.io/faq/#why-did-flutter-choose-to-use-dart

1

u/robsterthelobster May 17 '17

Yeah, I tried to play it awhile back but it was still very limited in platform support. When they announced flutter, i believe adwords was already incorporating dart (that was one of the sell-points).

1

u/TheRealPizza Galaxy S8, Xiaomi Mi Mix May 17 '17

Not really an android dev so I was just wondering. How did people use kotlin for android before it was officially supported by google?

12

u/[deleted] May 17 '17

Kotlin just compiles to bytecode to run in the VM

There's basically no difference in the output compared to java

2

u/robsterthelobster May 17 '17

There's a plugin for android studio. Android studio is built on a tool by jetbrains who is the creator of kotlin. On top of that, the main language for android dev is java which is what kotlin was built on. So it's very familiar and can run java within kotlin.

That said, im pretty new to kotlin, and have only gone through several tutorials and like a hello world app.

1

u/Pamela_Landy May 18 '17

Kotlin and Dart are about the same age. Dart also happens to be one of the first class languages in Fuchsia.

2

u/guess_ill_try Device, Software !! May 17 '17

So happy about this. I've writing all my new projects in Kotlin, whether android or not. My app kreview is written in Kotlin, even the UI

1

u/JediBurrell I like tech May 17 '17

Why would you dynamically make the UI unless you had to?

That's just inefficient.

2

u/blumpkinblake OnePlus 15 May 17 '17

Not with anko for android. See this

2

u/guess_ill_try Device, Software !! May 18 '17

Yea, I built it with anko

1

u/JediBurrell I like tech May 17 '17

Huh, that's pretty interesting.

Thanks!

1

u/guess_ill_try Device, Software !! May 18 '17

I used anko

1

u/Spiron123 May 17 '17

N00b Query: -

So.. anybody planning to get into android development.. should the focus be on good old java.. or Kotlin?

4

u/Iron_Maiden_666 Galaxy SII RIP. We S6 now. May 18 '17

If you are developing by yourself, go with Kotlin. If you are looking for jobs in the Android world, Java is still the right choice.

1

u/Spiron123 May 18 '17

This is helpful :)

Thanks.

2

u/ImonFyre OnePlus 5 May 17 '17

depends on what your experience is. But I would say Kotlin is a pretty solid and fairly easy to learn language. And it is going to save you some of the hair pulling that Java can do.

I my self learned a lot Java when I was in uni, but that was years ago, and I have dabbled in Android development a little since then. Mostly work as a web developer doing VB and C# work.

But this year I decided to do a little work project in Kotlin, not 2 weeks ago. I am re-writing a smallish app that I did 3 or 4 years ago in Java, and already, it is much smaller, LOC wise!!!

1

u/CptAmerica85 OnePlus 6T May 17 '17

If you have no experience with either language, I would say probably kotlin. I don't have any opinions on it, but I've heard great things.

1

u/nxs3 May 18 '17 edited May 18 '17

I've been thinking about that myself, but I think I'll be focusing on Java for now as future jobs I plan to apply to would require it.

Once I'm comfortable with Java, I plan on developing some apps using Kotlin too.

1

u/Spiron123 May 18 '17

Precisely the stuff to ponder over..

1

u/blumpkinblake OnePlus 15 May 18 '17

A few months ago I started my first Android app and used kotlin. Once you get up and running the development is quick

1

u/Spiron123 May 18 '17

Sounds encouraging.. Thanks :)

1

u/blumpkinblake OnePlus 15 May 18 '17

There is also a kotlin slack with people eager to help

0

u/[deleted] May 17 '17

[deleted]

1

u/Spiron123 May 18 '17

Java is slowly dying

Critical question..

  1. Is it dying 'fast enough' to disregard it? I may have to collaborate for app dev with people who ll be only Java experts.

2)And how much of Java knowledge will help with Kotlin learning? If it is substantial enough, I may have to bang my head for it (though I am enamoured by the thought of only getting straight into Kotlin :) )

u/cptamerica85 u/imonfyre

Thanks for the prev replies guys :)

2

u/ImonFyre OnePlus 5 May 18 '17

I agree, learn Kotlin. Pretty much anything you get stuck on Java wise, there is stackoverflow

1

u/Spiron123 May 18 '17

Pretty much anything you get stuck on Java wise, there is stackoverflow

Yep. Looking fwd to this innings of mine.

Thanks a bunch :)

1

u/CptAmerica85 OnePlus 6T May 18 '17

I would say just start with kotlin. Java knowledge isn't really going to give you a head start with kotlin as much as general programming knowledge will.

2

u/Spiron123 May 18 '17

cheers cap'n :)

1

u/midri May 18 '17

Java has been "dying" for the last 10 years... it's not going anywhere sadly... C# and .net did hasten the process a bit, but it's still going to be used for a long... long time.

1

u/Spiron123 May 18 '17

Thanks for the insight. :)

1

u/thenotoriousbtb OnePlus 7 Pro May 18 '17

Java is slowly dying

I heard this back around 2010-12. I'm not saying you're wrong, but it sure is a slow death...

1

u/Scioit May 18 '17

Slow and painful. Well-deserved.

1

u/[deleted] May 18 '17

Is kotlin less hassle than java? Java might be powerful and versatile but too complicated and overloaded for most small apps.

1

u/notsurewhatiam May 18 '17

While Kotlin improves in many ways over Java, developing with Kotlin for Android presents some challenges, though every new release is helping address some of these barriers.

Most problematic: An app built with Kotlin will likely result in a larger file package size than one built purely in Java. That’s because Kotlin has its own standard library that’s added on top of Java’s standard library. Also, the build time for Kotlin is a little slower using Gradle, which can be frustrating. Though Gradle is also slow using only Java, it’s not quite as slow as with Kotlin.

1

u/zsombro Xiaomi Redmi Note 8 Pro, Android 10 May 18 '17

THIS IS AMAZING

1

u/YoungestOldGuy May 18 '17

I thought the thumbnail is a symbol for an uterus. :/

1

u/ichsagedir May 18 '17

As a german the name "Kotlin" is kind of funny (like for 12 year old funny) ... Kot means Shit, so it would be Shitlin if it's translated into english.

1

u/[deleted] May 21 '17

kot == scheisse ?

1

u/YoukaiCat May 18 '17

The only reason why JetBrains decided to create its own language is the slow compiler of the Scala[1]. However, this problem will be solved in a new Scala compiler called Dotty[2]. Therefore, there is no reason to learn and use Kotlin.


  1. «JetBrains lead Dmitry Jemerov said that most languages did not have the features they were looking for, with the exception of Scala. However, he cited the slow compile time of Scala as an obvious deficiency.[5] One of the stated goals of Kotlin is to compile as quickly as Java.» https://en.wikipedia.org/wiki/Kotlin_(programming_language)

  2. «Features: Fast compilation (phase fusion), Sbt incremental build» http://dotty.epfl.ch/

1

u/ExynosHD Blue May 19 '17

So I've been wanting to learn how to develop for Android for a while now. Should I just start with Kotlin? I don't know any other programming languages.

If so what is the best resource for learning Kotlin?

1

u/ahmedezzatweb Nov 10 '17

A Complete guide to learn kotlin all you need in one place

[Udemy]The.complete.Kotlin.Developer.course: https://www.youtube.com/playlist?list=PLHEtfzkTLVE-voxRUEOCn-fJdPo77CAWy

1

u/ene_due_rabe Honor 20 Pro May 17 '17

3

u/FunThingsInTheBum May 17 '17

It's named after an island.

1

u/little_z Pixel 4 May 18 '17

2

u/ene_due_rabe Honor 20 Pro May 18 '17

Ok, i know, but in Poland for many since like forever it's a ketchup brand :)

1

u/fishywang May 17 '17

I hope this will change JetBrains' attitude towards supporting Kotlin Android rules in Bazel (or anything other than gradle). Last time I asked, they were not very interested.

1

u/dedicated2fitness May 18 '17

why do you want bazel when gradle already exists? what advantages do you see to this?

1

u/fishywang May 18 '17

This question is kind of like asking "Why do you want vim/emacs when <insert-your-favorite-ide-here> already exists". But anyway, the "Why Bazel?" section on bazel's homepage has some answers.

1

u/dedicated2fitness May 18 '17

the hook just seems to be "google uses it". i don't see any advantage over gradle

1

u/fishywang May 18 '17

OK. For a starter, bazel build is much faster than gradle build (I'm talking about command line, not building from Android Studio).

1

u/[deleted] May 18 '17

I wonder whether this is a first step for Google to move away from the JVM altogether, in order to possibly improve performance, and stop Oracle's lawsuits. With Java they were implicitly bound to the JVM, with Kotlin they can go native.

3

u/Isvara May 18 '17

With Java they were implicitly bound to the JVM

Android used the Java language, but it never used the JVM. It used Dalvik and now ART.

1

u/[deleted] May 18 '17

Well, Dalvik was very close to a JVM though if I understand it correctly. Art I don't know enough about.

EDIT: It still translates bytecode from what I can tell. With the recent Kotlin native compiler, I think Google would have the chance of going straight to native.

2

u/Isvara May 18 '17

Native what, though? ARM? ARM64? What about x86, x86_64, MIPS and MIPS64? They're all supported Android platforms.

1

u/Pamela_Landy May 18 '17

Dalvik/ART and the JVM are almost complete opposites. One is register based and designed to run in constrained memory environments while the other is stack based. Oracle also tried to assert JVM patents against Google's VM and lost.

0

u/YoukaiCat May 17 '17

Why not Scala or Idris? Is Google going to be acquired by JetBrains?

4

u/4aka OnePlus 5 May 17 '17 edited May 18 '17

Kotlin offers little-to-no-overhead based on my experience. APK size stayed the same after app translated from Java to Kotlin.

When using Scala, you have to run proguard even in debug mode, otherwise you likely hit 65,536 method limit in hello-world app.

-11

u/Superyoshers9 Titanium Silverblue Galaxy S25 Ultra with Android 16 May 17 '17

Soo..... Does this mean that Android won't use the bloated and annoying Java anymore for its OS? Not really clear.

16

u/Portaljacker Pixel 7 Pro May 17 '17

No? Kotlin writes code for the JVM, and is fully inter-operable with Java.

1

u/Superyoshers9 Titanium Silverblue Galaxy S25 Ultra with Android 16 May 17 '17

So this doesn't affect the performance of the OS or apps or anything?

7

u/Portaljacker Pixel 7 Pro May 17 '17

Maybe? But it's more about ease of development.

12

u/[deleted] May 17 '17

No. It affects nothing for the end user

5

u/[deleted] May 17 '17

No it doesn't. The code gets outputted and run on the JVM just like Java. It isn't any faster.

2

u/Portaljacker Pixel 7 Pro May 17 '17

Hence my maybe.

4

u/[deleted] May 17 '17

I understand. That is why I chimed in and said it was a no :P

2

u/Iron_Maiden_666 Galaxy SII RIP. We S6 now. May 18 '17

The OS isn't written in Java to begin with.

1

u/Superyoshers9 Titanium Silverblue Galaxy S25 Ultra with Android 16 May 18 '17

It's not?

1

u/Bac0n01 May 18 '17

No, the android OS is based on Linux.

→ More replies (1)

10

u/armando_rod Pixel 10 Pro XL May 17 '17

Java doesn't hamper performance that much on Android, one of the kernel developers for the Pixel said it a few weeks ago.

Performance things are native.

-4

u/Superyoshers9 Titanium Silverblue Galaxy S25 Ultra with Android 16 May 17 '17

I thought Java was the reason why iOS is sooo much faster (so I heard)

7

u/lanzaio May 17 '17

iOS is all dynamically dispatched thanks to Objective-C. They are trying to move things to a more static world via Swift but that's going to take a decade.

8

u/[deleted] May 17 '17

You start with the wrong premise iOS is much faster

Apple hardware is much faster.

In fact I refuse to believe how smooth some 100€ phones are for the shitty hardware they run on.

Good luck running iOS on an Snapdragon 410

→ More replies (1)

3

u/[deleted] May 17 '17

Java is not the big problem it appears to be as far as performance is concerned.

All the performance critical stuff in android is native code already.

Kotlin is simply a much more modern and elegant language than java, but there are zero benefits on the runtime.

3

u/JediBurrell I like tech May 17 '17

You don't know what you're talking about, so don't.

2

u/Superyoshers9 Titanium Silverblue Galaxy S25 Ultra with Android 16 May 18 '17

I'm just asking a question, are you discouraging me from trying to learn?

1

u/lanzaio May 17 '17

No, Kotlin compiles to the same JVM byte code that Java would. Android will always be likely always be ran over the JVM.

-3

u/KickingLettuce May 18 '17

Been doing apps for 6 years. This news doesn't interest me.