Shorter: `val word: Live<String> = _word`
# android
y
Shorter:
val word: Live<String> = _word
a
Also less efficient, this creates an additional backing field to save the same reference rather than a public getter for the same backing field
a
Do you mean
val word: LiveData<String> = _word
is less efficient than
val word: LiveData<String> get() = _word
?
y
Are you sure? For me this is simply syntax sugar
a
You can take a look at the generated bytecode but last I checked, yes, if you don't include the
get() =
it means you create a new field in the object to hold the value
👍 2