Hear kotlin is officially supported on android

>hear kotlin is officially supported on android
>hear kotlin is really good
>go to kotlin website
>see this retarded syntax
WELP

What is wrong with google? Why do they make android so shitty? (I still think it's far better than iOS though).

Other urls found in this thread:

try.kotlinlang.org/
twitter.com/NSFWRedditGif

Looks like Python and Java crammed together.

Lol

Google wanted a swift like language, and JetBrains already provided the tooling so yeah they went for kotlin.

They could actually care about Go and provide some android suport trough the NDK.

>args
What the fuck

>judging a language from a hello world

Please leave.

It actually looks kinda like Go and Java

Seriously, why the fuck do they need to go after so much random shit.

Every single fucking i/o they discontinue the product they announced last year and announce the new version that is the same shit with a different name

They're doing it with programming now, give it another year or 2 and Go won't exist anymore, it will be called fucking gopher or lamp or some stupid shit but have the same syntax and look the exact fucking same

I've written a couple of apps in Kotlin and aside from the learning curve it's great. Not having to check for null so often is a relief.

such a big change from argv and argc...

can't believe they'd do this

They do it to renew the market and eliminate any chance of real competition. It's the good old EEE of the 90's rebranded.

>fun
xD

They fucking ported this shit to Minecraft too you can write mods in it

It's techincally portable to anything w/ java because it uses the JVM.

You can write Minecraft mods in Clojure if you wanted to.

>try {
>
>} catch {
>
>}

shit language

Nothing wrong with that. Are you unemployed by any chance?

This is your code, simplified. It compiles perfectly fine.

Note that `: Int?` isn't necessary, but just adds clarity for studying.

>could have gone with Scala, Frege, Eta, or Clojure
>went with something inferior to all of them

In the real world, high level languages require exceptions. This isn't a language for fizzbuzz or your little Euler challenges

>>could have gone with Scala, Frege, Eta, or Clojure
Not with the same level of effort, Kotlin plays nicely with Java.

>Kotlin plays nicely with Java.
So do Scala and Clojure.

Can you chain the question mark type operator? E.g.

val m: Map = ...
val i: Int?? = m.get(3)

...

Playing around with try.kotlinlang.org/ suggests that a second question mark is redundant. So if you have a Map, you can't tell from the result of getting a key whether it was present in the map and null, or not present in the map.

What year is this again?

>Not using AOP to catch exceptions

>AOP
Get out.

I could do `x?.times(y)`, but I'll have to make an Int.times(Int?) operator method, which is really redundant, especially since it returns an `Int?`, just like I have it normally

>`
Broken ' key?

>the developers of the language should spend a bunch of time writing a parser that can handle every corner case that can arise with whitespace and ducktyping instead of making the language good

Hrm?

Oh -- I'm just too used to Markdown. It surrounds code.

Looks like a fucking shitty ripoff ot Typescript

Typescript is better than Javascript but it's still shit because it's a superset of Javascript and is still resting on a foundation of garbage.

yeah, the idea is sound, but I still can't stand that some javascript retarded decisions will keep live on somewhere and ruin my code in unexpected way.

I thought the !! operator throws a NPE?

Just ran it w/ bad values, aaaand you're right.

Shit.

Wait, so I need to create an Int.times(Int?), simply because I have two possible nulls?

Damn it.

Or
println(if(x! = null && y! =null) x*y else "error")

On my phone, can't check if it works

Worked; I had to change `x! = null` to `x != null` because it was pedantic like that.

also, .toInt() returns either an Int or an Arithmetic Error, but .toIntOrNull() returns a proper "Int?".

Sweet. It's a good language in my opinion. I'll be playing around with it a bit more later on.

>Int?

> using meme language that do not have first class support, no matter what "they" claim, like kotlin or Scala
> muh syntactic sugar

In Kotlin, "Int?" is either an Int or null.
An "Int" would be an assured, 100% guaranteed Int. This is the same for any other object.

An "Int?" can't have any methods be called until you make sure that it's not null. It's a feature in Kotlin that helps prevent Null Pointer Exceptions.

This language, what it's target demographic?

> meme language
Any language is a meme, as it's an idea spread from person to person. Even your superior ANSI C / C#.

> muh syntatic sugar.
Syntatic sugar is the difference between saying "turn off the lights" and saying "locate the switch that controls the light on the wall, and flip it from the on position to the off position, so that the current to the light will stop running."

It makes a difference when you need to say it every other day.

Anybody that uses the JVM but doesn't like how boilerplated Java feels. Demographics include Android app developers, Java desktop application developers, etc etc, anything that compiles into a JAR.

>Are
>An "Int?" can't have any methods be called until you make sure that it's not null.
So basically it's useless

Can you please elaborate on that?
As I understand in enterprise environment we need exceptions to be explicit about what's happening in the code so it is easier to read.
Also to be able to handle exceptions in a timely manner without shitting on a full call stack.

Besides making you right safe code and to assure you won't be getting a null. It also encourages you to avoid using null at all.

So its worthless besides the point of it being in the language