Linked by Thom Holwerda on Thu 18th May 2017 15:57 UTC
Android

I'm a little late with all the stuff from Google I/O last night due to personal issues keeping me from my PC, so let's catch up. There's a ton of interesting stuff, but I think what OSNews readers will be interested in the most is the Android project officially adding support for Kotlin.

Today the Android team is excited to announce that we are officially adding support for the Kotlin programming language. Kotlin is a brilliantly designed, mature language that we believe will make Android development faster and more fun. It has already been adopted by several major developers - Expedia, Flipboard, Pinterest, Square, and others - for their production apps. Kotlin also plays well with the Java programming language; the effortless interoperation between the two languages has been a large part of Kotlin's appeal.

The Kotlin plug-in is now bundled with Android Studio 3.0 and is available for immediate download. Kotlin was developed by JetBrains, the same people who created IntelliJ, so it is not surprising that the IDE support for Kotlin is outstanding.

And the announcement from the Kotlin project itself:

For Android developers, Kotlin support is a chance to use a modern and powerful language, helping solve common headaches such as runtime exceptions and source code verbosity. Kotlin is easy to get started with and can be gradually introduced into existing projects, which means that your existing skills and technology investments are preserved.

As for user-facing features in Android O, it's definitely a more low-key affair than earlier releases, with most new features fitting neatly in the "huh, neat" category. With a massive low-level project like Treble underway, it makes sense for Android to not rock the boat too much with this year's release. There's Notification Dots, smarter text selection, completely redesigned emoji, and more. There's also Android Go, but I'm saving that for a later item.

Order by: Score:
Great
by WorknMan on Thu 18th May 2017 16:57 UTC
WorknMan
Member since:
2005-11-13

Yet another programming language that people have to learn, and worse yet, it has curly braces ;) They should've just added Python support and called it a day.

Reply Score: 0

RE: Great
by moondevil on Thu 18th May 2017 17:29 UTC in reply to "Great"
moondevil Member since:
2005-07-08

Sure, then Android apps would be really fast, not!

Reply Score: 2

RE[2]: Great
by grat on Thu 18th May 2017 19:25 UTC in reply to "RE: Great"
grat Member since:
2006-02-02

Sure, then Android apps would be really fast, not!


But they'd have beautiful indentation.

Reply Score: 4

RE[2]: Great
by darknexus on Thu 18th May 2017 20:22 UTC in reply to "RE: Great"
darknexus Member since:
2008-07-15

Sure, then Android apps would be really fast, not!

And that would be different from now... how?

Reply Score: 2

RE[3]: Great
by moondevil on Thu 18th May 2017 21:44 UTC in reply to "RE[2]: Great"
moondevil Member since:
2005-07-08

Let me know when Python gets a JIT/AOT compiler as fast as ART or clang.

And no PyPy isn't it.

Edited 2017-05-18 21:44 UTC

Reply Score: 4

RE[4]: Great
by adkilla on Fri 19th May 2017 00:30 UTC in reply to "RE[3]: Great"
adkilla Member since:
2005-07-07

There is, it is called Cobra:
http://cobra-language.com

Reply Score: 2

RE[5]: Great
by moondevil on Fri 19th May 2017 08:31 UTC in reply to "RE[4]: Great"
moondevil Member since:
2005-07-08

Cobra achieves 1 by following Python and Ruby (but not religiously). It achieves 2 by favoring static typing ("i = 5" means "i" is an integer and always will be) and leveraging .NET|Mono for machine code generation.


Doesn't look like Python to me, rather a programming language that is inspired on Python syntax.

Edited 2017-05-19 08:31 UTC

Reply Score: 3

RE[6]: Great
by grandmasterphp on Sun 21st May 2017 15:45 UTC in reply to "RE[5]: Great"
grandmasterphp Member since:
2017-05-15

Looks a little be like VB

Reply Score: 1

RE[2]: Great
by Soulbender on Fri 19th May 2017 06:33 UTC in reply to "RE: Great"
Soulbender Member since:
2005-08-18

Faster than with Java.

Reply Score: 2

RE[3]: Great
by moondevil on Fri 19th May 2017 08:29 UTC in reply to "RE[2]: Great"
moondevil Member since:
2005-07-08

Python faster than Java?!

On which world?

Reply Score: 2

More Info On Kotlin?
by Pro-Competition on Thu 18th May 2017 19:53 UTC
Pro-Competition
Member since:
2007-08-20

Does anyone have any informed opinions about Kotlin, especially in comparison to other languages?

(In particular, it seems to share more than a few design decisions with Rust, but I'm no language expert.)

Reply Score: 3

RE: More Info On Kotlin?
by iampivot on Fri 19th May 2017 00:40 UTC in reply to "More Info On Kotlin?"
iampivot Member since:
2005-08-09

Here's a comparison to Java; https://kotlinlang.org/docs/reference/comparison-to-java.html

Don't have any links for comparison to Rust, sorry.

Reply Score: 1

Thanks!
by turrini on Thu 18th May 2017 20:19 UTC
turrini
Member since:
2006-10-31

But I will stick with C++/Qt/QML, even with its own glitches.

Reply Score: 2

RE: Thanks!
by moondevil on Thu 18th May 2017 21:43 UTC in reply to "Thanks!"
moondevil Member since:
2005-07-08

Sorry I forgot, what is the name again of that worldwide successful mobile OS using Qt/C++?

Reply Score: 1

RE[2]: Thanks!
by kwan_e on Thu 18th May 2017 22:50 UTC in reply to "RE: Thanks!"
kwan_e Member since:
2007-02-18

What does that have to do with his preference to stick with Qt/C++/QML?

Reply Score: 5

RE[3]: Thanks!
by moondevil on Fri 19th May 2017 08:28 UTC in reply to "RE[2]: Thanks!"
moondevil Member since:
2005-07-08

We are discussing about Android development and all operating systems that adopted Qt/C++/QML as their official development tools failed to gain market adoption.

Even worse, none of those companies has contributed their Qt/C++/QML back to Qt folks.

Reply Score: 2

RE[4]: Thanks!
by kwan_e on Fri 19th May 2017 11:56 UTC in reply to "RE[3]: Thanks!"
kwan_e Member since:
2007-02-18

Yes. And what does that have to do with his preference of using Qt/C++/QML? None of those are reasons for personal preference. To put it another way you may understand, why should my personal preference for, say, The Pixies, should be affected by anyway by the fact that more people like Lady Gaga?

What I understand about Qt on mobile is it doesn't need to be the main development environment. So you listed examples of what wasn't successful on a platform level. That's not the same as being an agnostic development environment in general.

And mobile developers have to pay a licence fee, so they are giving back to Qt.

Reply Score: 6

RE[2]: Thanks!
by adkilla on Fri 19th May 2017 00:31 UTC in reply to "RE: Thanks!"
adkilla Member since:
2005-07-07

You mean Tizen?

Reply Score: 2

RE[3]: Thanks!
by moondevil on Fri 19th May 2017 08:28 UTC in reply to "RE[2]: Thanks!"
moondevil Member since:
2005-07-08

Tizen uses its own stack based on EFL libraries and is slowly migrating to .NET Core.

Reply Score: 2

Comment by Flatland_Spider
by Flatland_Spider on Thu 18th May 2017 21:24 UTC
Flatland_Spider
Member since:
2006-09-01

I do like the "when" statement. It makes more sense then "switch".

https://kotlinlang.org/docs/reference/control-flow.html#when-express...

Reply Score: 1

Comment by Mikaku
by Mikaku on Fri 19th May 2017 21:34 UTC
Mikaku
Member since:
2007-05-03

.

Edited 2017-05-19 21:34 UTC

Reply Score: 1

Kotlin
by przemo_li on Sat 20th May 2017 09:04 UTC
przemo_li
Member since:
2010-06-01

Kotlin looks like better OOP Java.

Disapointed they didn't introduced some functional JVM language ;)

Reply Score: 2

Fantastic news for Android and Java
by LouisBarman on Sat 20th May 2017 09:53 UTC
LouisBarman
Member since:
2010-06-06

Actually this is great news for both Android and Java. Java is now such an old language and it is really showing it's age. It was invented as a C++ replacement by those clever people at Sun Microsystems (remember them?) who knew best about how we developers should write programmes, forcing us to handle typed exceptions and we developers should always declare the correct types shouldn't we! And we definitely should not be using pointers. But just what were they thinking about allowing those pesky nulls.

Apparently there was an AH HA ha moment at Sun when thinking of a new feature they really needed in Java, only to be told by Python programmers that they have had this for years, it is called duck typing.

The have been various attempts to fix and modernise Java. Groovy was good but too slow as it is a scripting language. And then there is Scala which is very good but maybe just too clever. Apparently you could not always follow what an advanced Scala programmer had done just by reading the code, and you often had to use a debugger just to figure out what is going on. Also Scala is a heavy language which greatly increases the size of any Android app.

However at JetBrains they took a completely different approach when designing Kotlin, they wanted a new modern lightweight language that would work perfectly with existing Java code. Allowing Java and Kotlin to be seamlessly mixed together in the same project without taking any performance hit is one of the main goals of Kotlin. This means you don't have to wait for a new big project when switching to Kotlin, you can gradually start using it in any existing Java project.

Anyway I found this blog called “Why Kotlin is my next programming language” that explains this better than me. See https://medium.com/@octskyward/why-kotlin-is-my-next-programming-lan...

Reply Score: 1

Alfman Member since:
2011-01-28

LouisBarman,

Apparently there was an AH HA ha moment at Sun when thinking of a new feature they really needed in Java, only to be told by Python programmers that they have had this for years, it is called duck typing.

The have been various attempts to fix and modernise Java.


I agree modern languages that incorporate features from the get-go are cleaner than those that have them hacked in later, the burden of supporting large pre-existing code bases holds them back.


But just what were they thinking about allowing those pesky nulls.


Nulls are unavoidable for many structures, including in Kotlin. However I realize you are referring to optionally nullable types that can statically enforce not-null, and I agree that's not a bad feature. I like bringing languages on par with nullability in databases where fields can statically be declared as nullable or not, whichever makes the most sense.

However at JetBrains they took a completely different approach when designing Kotlin, they wanted a new modern lightweight language that would work perfectly with existing Java code. Allowing Java and Kotlin to be seamlessly mixed together in the same project without taking any performance hit is one of the main goals of Kotlin.


I'm glancing through Kotlin, but the difference looks mostly syntactic. Not to criticize it for that per say, but does Kotlin offer anything over Java in terms of functionality?

Reply Score: 2

Lipstic on a pig
by Verenkeitin on Mon 22nd May 2017 20:43 UTC
Verenkeitin
Member since:
2007-07-01

Language with a nicer syntax means squat when android API itself is an absolute piece of crap. Its a relic from a bygone era of xml-all-the-things and devices not really being able to run Java.

Reply Score: 2