Ask HN: What can lead to misleading names of functions?
2) What about functions like getOurCityTimezone() ? This functions seems to be returning timezone of our city but what it really does is checking if current time is before certain deadline (determined by specific business rules). I can't give simple explanation to this. This looks like: * Programmer who wrote this function, is not fluent in English. Even with this statement the name is too divergent from real meaning of function to be just lexical mistake. And the programmer could translate it roughly with Google Translate; * This function would be initially called as "isBeforeOurCityTimezone", but as programmer wasn't such fluent in English, this was called "getOurCityTimezone". AND it really determined if current time is before 00:00 (next day) in local time. And it was used to calculate date gap. But then business decided to shift border from 00:00 to earlier time like 23:00 . And for the sake of backwards compatibility, avoiding copypasta and not "wasting" time for refactoring only the body of function was changed. The name remained the same;
What are common reasons to misleading names of functions?