What I got was that there are two types of optimization.
1) rewriting the implementation of a function to be faster or more efficient
2) making it so that function never has to be called in the first place.
What I think OP is trying to say is that we should be trying to do method 2 a lot often when we refactor, but it can be hard to determine why the function was written in the first place simply from the function's existence.
We're a place where coders share, stay up-to-date and grow their careers.
What I got was that there are two types of optimization.
1) rewriting the implementation of a function to be faster or more efficient
2) making it so that function never has to be called in the first place.
What I think OP is trying to say is that we should be trying to do method 2 a lot often when we refactor, but it can be hard to determine why the function was written in the first place simply from the function's existence.