> Scala generates public getters for all public member
God what a sad, sorry existence you must live to be writing about "getters" in 2017. Java programmers and their descendants are the true Luddites of the programming world.
> Scala generates public getters for all public member
God what a sad, sorry existence you must live to be writing about "getters" in 2017. Java programmers and their descendants are the true Luddites of the programming world.
Allow flexibility to support such requirements later on, without forcing people to break source and binary compatibility, unlike in Java, C# etc.
That's the reason why you can e. g. implement or override a def with a val.
Especially in Kotlin and Scala where data tends to be immutable by default there isn't much to gain by using getters.
If your "getter" is doing more than getting the value then maybe you should not call it a getter (imo).
I'd definitely agree there! In fact, I might go further and say that if your "getter" does more than just return a member, then by definition it isn't a getter