Live data from Hacker News

Learn Kotlin in Y Minutes

learnxinyminutes.com

151–160 of 239 posts

Re: Learn Kotlin in Y Minutes

#151
post #104

Earlier quoted context omitted.

While somewhat longer, you do have var map = hashMapOf("a" to 6, "b" to 12) var list = listOf(1, 2, 3) This is still not Java-level verbosity.

I like that a lot, but the `to` syntax bugs me. Why not a colon, or Scala's `->`?

You type "->" faster and easier then "to"?

Re: Learn Kotlin in Y Minutes

#152
post #25

I'm a bit disappointed that there's no metaprogramming support in Kotlin. Even Groovy had some AST-level transformators. Maybe we'll get some high-level API for writing APT-level tools in Kotlin itself ...

If you're looking for metaprogramming on the JVM, and like the semi-functional approach of Kotlin, you should definitely take a look at Clojure.

I hate clojure, but that complaint is EXACTLY what I was thinking must drive clojure users to it in the first place. Clojure just seems dumb because the jvm is such a hassle and bloated, sbcl is incredible, racket is good, guile is incredible, etc plenty of other lisp environments, why waste time on java?

I hope kotlin native is as good as scala native. I don't care about kotlin vs Java, but kotlin vs scala native is HUGE to me.

Re: Learn Kotlin in Y Minutes

#153

Earlier quoted context omitted.

my beef is with 'val' being keyword. How many variables did you name val in all your coding? I certainly did.

`val` is never an appropriate name for a variable because it tells you nothing at all about what the variable contains.

never is strong requirement. maybe it doesn't need to tell. Int::add(int val)

Re: Learn Kotlin in Y Minutes

#154

Earlier quoted context omitted.

my beef is with 'val' being keyword. How many variables did you name val in all your coding? I certainly did.

`val` is never an appropriate name for a variable because it tells you nothing at all about what the variable contains.

Except when iterating through a hash, where 'key' and 'val' are my go-to names for stuff

Re: Learn Kotlin in Y Minutes

#155
post #51

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 anythi…

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.

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

#156
Could someone paraphrase the argument for learning Kotlin? I understand it's essentially Jetbrain's fork of Java, motivated to some degree by the desire to provide useful realtime information to programmers working in the Jetbrains ecosystem. Presumably this implies that certain features present in Java that are ambiguous at compile time (e.g. generic types) might be winnowed away in the pursuit of a language more conducive to static analysis?

Re: Learn Kotlin in Y Minutes

#157

Could someone paraphrase the argument for learning Kotlin? I understand it's essentially Jetbrain's fork of Java, motivated to some degree by the desire to provide useful realtime information to programmers working in the Jetbrains ecosystem. Presumably this implies that certain features present in Java that are ambiguous at compile time (e.g. generic types) might be winnowed away in the pursuit of a language more co…

It’s not a fork of Java, it’s a language that uses the JVM like Scala. It’s not at all like Java, it’s a modern language more akin to Swift with lots of syntactic sugar.

Re: Learn Kotlin in Y Minutes

#158

It looks like there's been a very conscious effort to strike a midpoint between Java's familiar clunkiness and Scala's hipster experimental side. I think that's a good thing, you end up with a language that feels pragmatic and powerfully practical.

Which is funny, because Scala is a pragmatic mix that's halfway between more "pure" functional languages and Java. Guess the sweet spot is a quarter of the way there, not halfway. :)

Re: Learn Kotlin in Y Minutes

#159
post #132

I like this val z = (1..9).map {it * 3} .filter {it I'd like it more if it said it performed the functions in parallel. If it does this Automagically I'm sold. If it doesn't, is there an easy to use form that does do batch operations like map in parallel?

Scala has parallel collections that allow for this, looks exactly the same syntax too.

Re: Learn Kotlin in Y Minutes

#160
post #32

Earlier quoted context omitted.

I'm guessing here: With const there's always the disccusion about consts not being constant, e.g. when referencing an array or object (reference itself is constant). With "val" you don't have that confusion?

But why not let? Or any word that doesn't start with "va"?

I've been writing Kotlin for a year and a half and it has yet to be an issue.
Post reply on HN