Earlier quoted context omitted.
That's an extreme position. Function names are a valuable hint of what the function is supposed to do. But if the name doesn't match the implementation, which one is wrong? We don't know.
> We don't know. 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.
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.