Even if the product has been running flawlessly in production for 5+ years?
"Proven in use" and backwards compatibility is a bitch.
Well, if it's a library function like printLine and it does something else instead of printing to the console, that's probably a mistake (though if it does something so wildly different it cannot be simply a bug, for example logging to a file, I'd still wonder if the name is wrong). The problem is that you can't generalize this reasoning. For example:
def sumAllNumbers(nums: List[Int]): Int = {
nums.filter(_ % 2 == 0).sum
}
Is the function name wrong or is the implementation? We can't tell without looking at how the function is used, and maybe not even then! Maybe we have to ask the person who made the last change. Maybe they changed the implementation for a valid reason and forgot to change the name. It happens!So the name definitely helps, but it's not conclusive.
I don't know about you but I certainly know that if a printLine function accidentally does something else, it's definitely the code that's wrong and not the function name.