@kotlin tweet about ability to override `val` with `var` got negative reactions. What are your thoughts?

Andrey Breslav - It feels like you are assuming that val means “immutable” while it actually means “read-only”. The rationale is the pretty common practice to define read-only interfaces with mutable subclasses

Tomer Aberbach - I think if the property in the super class was not prefixed with "open" then you could be certain that it remains constant (since it couldn't be overwritten)

G. - Everyone is complaining, but that's the same as overriding the val's get

DJ Todd - Does the set need to be protected in this case? It would make sense. The same way you could have written a getter for value in Read that would work the same as the overridden var.

Kane Shih - Always be careful on opening a field to the child class. Even a val could be changed. If you want to make sure it’s unchangeble, just don’t make it open.

/r/Kotlin Thread