Keywords var and val are too similar


#1

I like Kotlin, but there is an issue with the readability on one point: In my opinion the two keywords val and var are too similar. Both are only 3 characters in length and the first two characters are same. This makes it very difficult to distinguish them when reading source code. I believe that the readability of source code is very important and therefore keywords should be chosen that are easier to distinguish. For example: var and const


#2

I like the two keywords since they are short, have the same length (what leads to very readable code formatting) and they are expressive. I've never heard anyone complaining about var and val in Scala. There is simply no reason to worry in practice.


#3

Hi Michael,

I believe almost everyone will use IntelliJ to edit Kotlin sources and using it vars are highlighted very differently (underscored) - so there’s no chance of accidentally using a var.

Cheers,
Andrew