Reputation: 768
In a PR I got some suggestions to rename my variables. Suggestions were made to fi. concat *MutableLiveData
.
private val _state = MutableLiveData<AppointmentsUiState>()
val state: LiveData<AppointmentsUiState>
get() = _state
My two variables. It's an Android ViewModel. After the suggestions I agree that perhaps uiState
would be beter. However, 2 suggestions were stateMutableLiveData
and stateObservable
. I don't like those names, but my problem is that I can't think of a valid reason to not use their suggestions, other than:
Why wouldn't one put data types in variable names?
Upvotes: 0
Views: 1467
Reputation: 2295
You can see the type of your variables so if you write their type in their name, you just duplicate the information.
You couple the variable to its type, so if you change the type, you have to change the name.
If your variable has multiple interfaces, you would have to chose one of them.
Upvotes: 1