News for hackers. Stuff that matters.
Re:Learn Kotlin in Y Minutes by kodablah on Thursday May 18, 2017 @02:19PM (#14369667)
Kotlin as a language has expectations on IDE capabilities. I doubt the problem of accidentally typing "r" instead of "l" at the end of a keyword is as prevalent as someone typing "var" instead of "const" and not coming back to make it immutable. A quality compiler can warn about an unmutated mutable variable which solves all problems.

Remember recently on the Java mailing list there was a lot of bikeshedding concerning this point. I don't think it matters near as much as the discussion surrounding it thinks.

Oh, and finally, "const" has a specific meaning: compile time constants.

Re:Learn Kotlin in Y Minutes by BurningFrog on Thursday May 18, 2017 @02:46PM (#14369899)
The problem isn't typing, but reading.

Maybe other people's brains work differently than mine, but I'm sure I will be slightly slowed down by this.

Re:Learn Kotlin in Y Minutes by Larrikin on Thursday May 18, 2017 @03:07PM (#14370117)
When it comes to reading it is very clear in the IDE. val variables look normal (since immutability is encourage), var variables are underlined. You get used to it very quickly
Re:Learn Kotlin in Y Minutes by BurningFrog on Thursday May 18, 2017 @03:49PM (#14370499)
That does help a lot.

I'm happy to be dependent on my IDE.

Re:Learn Kotlin in Y Minutes by flamedoge on Thursday May 18, 2017 @05:38PM (#14371332)
my beef is with 'val' being keyword. How many variables did you name val in all your coding? I certainly did.
Re:Learn Kotlin in Y Minutes by j_jochem on Thursday May 18, 2017 @05:50PM (#14371412)
`val` is never an appropriate name for a variable because it tells you nothing at all about what the variable contains.
Re:Learn Kotlin in Y Minutes by tomc1985 on Thursday May 18, 2017 @07:19PM (#14371856)
Except when iterating through a hash, where 'key' and 'val' are my go-to names for stuff
Re:Learn Kotlin in Y Minutes by h1d on Thursday May 18, 2017 @10:34PM (#14372653)
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.

Re:Learn Kotlin in Y Minutes by eropple on Thursday May 18, 2017 @10:57PM (#14372728)
Agreed - at that point, I don't know why you wouldn't just (consistently) use 'k' and 'v'. 'val' adds some weird cognitive load, to me.
Re:Learn Kotlin in Y Minutes by tomc1985 on Friday May 19, 2017 @12:02AM (#14372935)
'value' is frequently a keyword or property on objects, and has specific meaning in a lot of contexts. For names, IMO 'k' and 'v' also work, but I find an abundance of single-letter variables hard to read. key and val it is.
Re:Learn Kotlin in Y Minutes by flamedoge on Thursday May 18, 2017 @11:03PM (#14372742)
I dunno, I am horizontally challenged. I like condensed code style like minimizing words, 2 spaces for indent, etc.
Re:Learn Kotlin in Y Minutes by flamedoge on Thursday May 18, 2017 @06:11PM (#14371526)
never is strong requirement. maybe it doesn't need to tell. Int::add(int val)
Re:Learn Kotlin in Y Minutes by rhizome on Thursday May 18, 2017 @10:13PM (#14372574)
I tend to use `num` in those spots.
Re:Learn Kotlin in Y Minutes by nobleach on Thursday May 18, 2017 @11:32PM (#14372836)
`val` isn't the variable name, it's the declaration. I'd imagine `val multiplier = 2' to make perfect sense. `var` likewise doesn't connote any truly valuable information other than the label for the memory location that follows is mutable.
Re:Learn Kotlin in Y Minutes by h1d on Thursday May 18, 2017 @10:35PM (#14372657)
None. However I have used 'value' for iteration when I couldn't think of anything better.
Re:Learn Kotlin in Y Minutes by cbhl on Thursday May 18, 2017 @10:15PM (#14372583)
I alway use (key, value) or (k, v). :p