3 ms·
But then the name of the function is somewhat tied to its inner workings. What if you change the implementation so that it returns a cached value? To quote Mich
by augustk 5y ago
But then the name of the function is somewhat tied to its inner workings. What if you change the implementation so that it returns a cached value? To quote Michael Caine, an interface should "Be like a duck. Calm on the surface, but always paddling like the dickens underneath."
- wvenable 5y ago> But then the name of the function is somewhat tied to its inner workings. Not necessary tied to it's inner workings but more tied to how you should use it. There are good reasons that a function might not cache it's value -- maybe because you want that fresh data each time. The name is the signal to the user how they should use it. I expect an "Instances" property to give me the same values each time. However with "FetchInstances()" I would store that result in my own variable if I want to keep referring to those instances. > What if you change the implementation so that it returns a cached value? That's a different function then. The semantics have changed significantly.