3 ms·
> Notice the subtle difference? Dropping those get prefixes for the access methods has significant benefits. Let's think about it: What value was added by the p
by donatj 2y ago
> Notice the subtle difference? Dropping those get prefixes for the access methods has significant benefits. Let's think about it: What value was added by the prefix? Correct, none!
Methods and functions do something rather than are something so naming them as the action they complete seems much better form to me. 3 characters is a fair price for clarity.
> Drop the getters and setters. They don't add any value
They add the ability for the underlying object to change without breaking compatibility. This is particularly important on shared libraries where you are not going to be able to refactor every single call sight.
For instance we have an object in our model representing a building, we've gone through *three* different structures of what a building is, but we've managed to make those changes while maintaining compatibility through leaving deprecated methods that translate the calls.