Out of professional curiosity, does anyone know wh...
# kontributors
a
Out of professional curiosity, does anyone know why the Kotlin team went with val/var as opposed to const/let naming conventions? I know the difference between the two, but someone asked me if I happened to know the reason behind the naming and I didn't. Nor am I sure there was an explicit reason but I thought I'd ask.
🤔 2
l
Not sure. I personally would hate to wite const/let
A wild guess is that maybe var/val have the same amount of leters, while const/let don't? this hels with aligning code and making it prettier-ish
d
Yeah, I dont think
const
and
let
are the right keywords. Imagine writing kotlin but with
const
everywhere you have
val
. Sounds horrible to me.
a
I definitely agree! Truly was just professional curiosity haha
My guess after thinking about this for a day is basically the same as Leonardo: it just reads better. Both stylistically being three letters, but var/val matching to variable/value is quite clear.
const
may be clear but what the hell is
let
with respect to a property honestly
d
Logic to Kotlin!
💯 1
d
I don't speak for the team, however, using
let
for mutable variables goes against my ML intuition :)
👍 2
e
fun
,
var
,
val
— aligns nicely, reads nicely (there was an official story somewhere from Andrey Breslav, but I cannot find it now)