Re:How Developers Choose Names
by 3grdlurker on Tuesday April 20, 2021 @11:32AM
(#26876004)
It’s not premature optimization, it’s just boilerplate because it’s a pattern that happens so often.
Besides, there’ll be less work if the requirements do in fact change, and there’s nothing wrong with accounting for the possibility of change when you’re writing code because what you write now constrains what you can write in the future.
This sounds like exactly the kind of pre-mature optimization that leads to overly-abstract function names throughout the codebase. Your point is a good one, once the function does something more than `updateDate()`. But until then, just call it `updateDate()`. As a bonus, this way any time you do choose to use `handleClick()`, the name is conspicuous enough that you pause to see what side effects it might have.