I have been using Java for quite some time and am still puzzled by this naming of API. Why is it like that?
For example when you have one instance of ArrayList
it has a property of how much objects are added to the list. To get this property you call .size()
and not getSize()
which would be more along the line of what you are actually trying to do. You are trying to read a value of the property of this list, not do some operation on it. I guess internally "sizing" this list is probably much more complicated then just reading a single variable but that is implantation detail and the user of the object should not care about that.