Are there any benefits from fetching stored data into other functions by calling a function to call a private variable, instead of calling the private variable directly? What is best practices?
example
contract PlayerExample {
uint private maximumPlayers
uint private players;
function playersCount() public view returns (uint) {
return players;
}
function playerSlotsLeft() public view returns (uint) {
return (maximumPlayers - players);
//or is it better to do
//return (maximumPlayers - playersCount());
}
}