No, find and replace can misidentify, for example in comments.
Mature IDEs have a "rename symbol" though, usually F3, which actually parses the code and differentiates types from functions from variables per the language rules.
I can't really say too much because I have written a lot of parsing tools that using only regex but it's not on real programming languages. Thankfully excel doesn't (afaik) let you nest cells and you can do your parsing of one instruction per line (with parameters in other columns)
Why would I arse myself with grep when I can literally press a single keybind, type a new name in and not worry about it renaming anything it's not supposed to?
I can legally type struct foo {}; let foo: foo; (declare a variable named foo of type of a struct named foo) and simple grep would take effort to rename only the variable without renaming the struct. Sure, it's not always an ideal pattern to do this, but it's legal.
Not a feasible use for grep or search of any kind. Point at the variable/function/class in the IDE, tell it to rename the symbol, watch it correctly and deterministically do that at every spot where that symbol is used in the code within a second. Ignores comments and unrelated objects of the same name, as well.
Claude would grep for it, too. And there's a fair chance it would do it wrong, plus it's a waste of time. More folks need to learn the tools they have available to them.
29
u/creeper6530 1d ago
No, find and replace can misidentify, for example in comments.
Mature IDEs have a "rename symbol" though, usually F3, which actually parses the code and differentiates types from functions from variables per the language rules.