This is an excerpt from Manning's book Swift in Depth. Login to get full access to this book.
The point is that good names don’t change. If you started with a LocationGrouper type, you could use it directly for both scenarios by adding a leastVisitedPlaces property; this would have prevented a naming refactor or a new type.