<@U589QURRQ> i don't see how it's the same thing :...
# getting-started
d
@diesieben07 i don't see how it's the same thing 🙂
d
I mean in terms of duplication
u
In both cases you define a field and a getter. Sounds like the same thing to me 🤔
d
I'm defining 2 fields and a getter here and 1 is a dummy field
u
Well effectively ‘myExposedData’ is a getter with the niceness added to it that you can refer to it as a regular field
You could also write just
fun getMyExposedData() {}
and that would work too but then you wouldn’t be able to refer to it as like a field
It is also a pretty common naming convention to write:
Copy code
private _myData: Implementation = Implementation()
val myData: InterfaceOrSuperclass
    get() = _myData
👍 1