3 ms·
> may have some internal checks that could eventually call something like updateDate This sounds like exactly the kind of pre-mature optimization that leads to
by TechBro8615 6y ago
> may have some internal checks that could eventually call something like updateDate
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.
- 3grdlurker 6y agoIt’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.