From the blog post “Bad names make you open the box” by Adam Zerner.
Imagine that you open the fridge. You see something labeled “brownie”. You eat it.
Then you hop in the car and start heading over to your friends house. But right as you merge on to the highway, you start feeling funny.
Turns out that the “brownie” label was a little misleading. It wasn’t a regular brownie. It was a pot brownie. There was something dangerous inside the brownie, but the label didn’t reflect that.
This is similar to poorly named functions with dangerous side effects. In both cases, if the thing in question can have dangerous side effects, you really want to make sure that it is reflected in the label. You can’t trust that people will read beyond the label. And even if you could, you wouldn’t want people to have to do that. You’d rather them be able to get the information they need from the label.Adam Zerner