Yeah this is a very very common and fundamental operation in programming. Always use the “refactor” tool in your IDE instead of trying to change every instance of a variable name by hand.
It’s like using a linter: you do it because it’s the right thing to do and doing it without the tool confers no benefit and is prone to error.
> i demonstrated replacing _all_of them at once, not replacing them each by hand.
Not really, that is search and replace. IDE's do typesafe refactoring. If you change the Find method in class A, you should only change occurences of x.foo(), where x has type A. You shouldn't accidentally change all B.find()'s.
That is my advice for everyone completing their first Python tutorial: learn a typed language next if you aspire to do serious work. It also saves you writing many manual tests that you had to make otherwise, as the compiler makes that superfluous. Plus your IDE becomes a superpower.
Comments
Yeah this is a very very common and fundamental operation in programming. Always use the “refactor” tool in your IDE instead of trying to change every instance of a variable name by hand.
It’s like using a linter: you do it because it’s the right thing to do and doing it without the tool confers no benefit and is prone to error.
That _is_ the refactoring tool in my IDE (emacs). i demonstrated replacing _all_of them at once, not replacing them each by hand.
There was nothing in my post done "without the tool." Shell/find/perl _is_ the tool for C refactoring, and has been for decades.
That is my advice for everyone completing their first Python tutorial: learn a typed language next if you aspire to do serious work. It also saves you writing many manual tests that you had to make otherwise, as the compiler makes that superfluous. Plus your IDE becomes a superpower.
I normally would use find replace in vscode but I either forgot that existed or I was enjoying myself too much