Earlier quoted context omitted.
Except when iterating through a hash, where 'key' and 'val' are my go-to names for stuff
Just use 'value'. Only you can be sure of shortened words even if it looks obvious. Not good in a team. I never understood people who shorten words to make the program look cryptic. Maybe it was someone who taught you how to program had it that way or somehow it makes you feel your program looks cooler if it looks more cryptic.
Learn Kotlin in Y Minutes
181–190 of 239 posts
Re: Learn Kotlin in Y Minutes
#182Earlier quoted context omitted.
Thankfully that would be a simple compile-time error. The message might even be readable.
If you type var and mean val - would there be any error? (I'm sure that this is just something you need to get used to, I'm merely trying to point out that this could be a silent typo/mistake)
Re: Learn Kotlin in Y Minutes
#183Earlier quoted context omitted.
Thankfully that would be a simple compile-time error. The message might even be readable.
If you type var and mean val - would there be any error? (I'm sure that this is just something you need to get used to, I'm merely trying to point out that this could be a silent typo/mistake)
Re: Learn Kotlin in Y Minutes
#184Re: Learn Kotlin in Y Minutes
#185Earlier quoted context omitted.
Thankfully that would be a simple compile-time error. The message might even be readable.
If you type var and mean val - would there be any error? (I'm sure that this is just something you need to get used to, I'm merely trying to point out that this could be a silent typo/mistake)
Re: Learn Kotlin in Y Minutes
#186Earlier quoted context omitted.
Hope we never see "looks exactly like Java syntax but behaves differently when you run it" like we see in Apache Groovy, e.g. their == operator acts differently to Java's.
Pretty much every language's `==` operator acts differently and more sanely when compared to Java's. Groovy had a very different initial design philosophy compared to Kotlin. The Groovy design philosophy was give Java developers a good highly-dynamic scripting language that still felt like Java but also made it more suitable for writing quick and dirty plugins, scripts and other extension bits to Java programs. Kotli…
Re: Learn Kotlin in Y Minutes
#187the whole kotlin debate is just a misguided stab at solving the pain that is programming for android. everyone everywhere hates android dev work. so they think that it must be java. no, java sucks, but kotlin sucks just the same. the problem is the android ecosystem as a whole. the ever changing apis. etc. wasting time on java vs kotlin is absurd with so many other real problems.
Probably everyone will try to hide your comment but that's the truth, there hasn't been a worse ecosystem than Android, learning the Android SDK it's so painful that even if they choose a decent language like Python to support it won't change the fact that the APIs would still be called in the same way, just look at the examples, same just sugar-coated flavor: https://github.com/JetBrains/kotlin-examples/blob/master/…
Re: Learn Kotlin in Y Minutes
#188In terms of why we'd want to, there is this note here: https://kotlinlang.org/docs/reference/comparison-to-java.htm... Other factors to consider are tools support, how often interoprability with java libraries causes problems. Would be nice to hear from someone who has used it a bit about what the state of these is?
To me the most promising aspect seems to be async-await on Android. It'd eliminate so much frustration in developing for that platform. In general, after bouncing between various desktop, mobile, and web-based technologies, I've come to the conclusion that any binding/event-based GUI system needs some sort of async-await or futures support to be truly workable. Otherwise, performing background tasks without locking u…
Re: Learn Kotlin in Y Minutes
#189Earlier quoted context omitted.
I agree with making mutability require more typing, although I'd prefer going without the redundant `let`.
It's not redundant; for example let (mut x, y) = (1, 2); x is mutable, y isn't. That is, let is the way that you introduce a new binding, always.
Re: Learn Kotlin in Y Minutes
#190Earlier quoted context omitted.
It's not redundant; for example let (mut x, y) = (1, 2); x is mutable, y isn't. That is, let is the way that you introduce a new binding, always.
Am I being a complete noob that only knows Python (I am) if I ask: Why do you need to declare that something is a mut or string or whatever? Python doesn't seem to need such extra lines with obvious declarations.