Of all the concerns there, typos gotta be the smallest. A val being typoed as var will work just like you intended it to. A var typoed as val will at worst trigger a compiler error. It's really innocuous.
Except that isn't the case, a val typoed as a var becomes mutable, and might lead to bugs if it's changed unexpectedly. The opposite would likely lead to a compiler error (or else just safer code since not erroring would indicate you should have used a val in the first place).
increasing opportunity for mistakes is no good. maybe on an individual level you never see the impact, but what if your product is being used by millions of people? flaws like this start to become problems that people complain about every day
1
u/kqr Mar 10 '16
Of all the concerns there, typos gotta be the smallest. A
valbeing typoed asvarwill work just like you intended it to. Avartypoed asvalwill at worst trigger a compiler error. It's really innocuous.