#ComputerScience #programming question:
You need to replace references to the variable "terrainHeightValue" in your code with "terrainHeatValue". You know it's limited to one function, and there are 5-8 instances to be replaced.
What do you do?
@LouisIngenthron How about use the refactoring tools in your IDE?
@PHolder Find & replace is much faster when you know the variable only exists in a limited section of text.
But also, I was limited to 4 options in the poll. 🤷♂️
@PHolder Same works with Visual Studio, and it works fine in smaller codebases, but in larger ones, it can take a few seconds to check every file for references.
With find & replace, otoh, I can highlight the variable name, press Ctrl+H and it prefills the "to replace" field and puts my cursor on the "replace with" field. Type it in and press enter and it's done, with no delay and only one mouse click.
@LouisIngenthron
>it can take a few seconds to check every file for references.
Okay but, your original question was "You know it's limited to one function"
I don't use Visual Studio, but Eclipse seems to know enough context when the variable is local to a single function and only quickly makes the changes there, not requiring checking anything/anywhere else.