4 ms·
Or in a GUI: Apple-Shift-F Find: <old name> Replace: <new name> …continue working.
by bsimpson 10y ago
Or in a GUI: Apple-Shift-F
Find: <old name>
Replace: <new name>
…continue working.
- shados 10y agoWon't work super hot if you have 2 functions with the same name in 2 different modules and you want to rename one and all its usages but not the other. It's quite impressive what VisualStudio + Resharper + plugins or IntelliJ with a few plugins can do in their respective first class languages.
- jeremiep 10y agoI used to like ReSharper but quickly uninstalled it from the large amount of false positives it reported. Back when I did C# last year I was doing 2D skeletal animations in Unity3D and pretty much wrote the most non-idiomatic C# code ever. Everything was bitfields, structures of arrays and integer indices into contiguous memory buffers rather than heap references. The tooling was completely useless there. You can't optimize for cache misses and branch predictions without throwing all that nice typed goodness out the window. As much as types, tests and whatnot can help you, at the end of the day it is impossible to do engineering without understanding what you're doing, regardless of what is there to do heavylifting for you.
- westoncb 10y agoThis doesn't actually work. Let's say the variable you'd like to rename is 'label,' and you also have variables named 'labelOne' and 'labelTwo'—see the problem?
- SiVal 10y agoThat crosses namespace boundaries and risks hitting embedded parts of names, which means that you can't simply replace all as a general practice. You can inspect each one before replacing and be your own type checker or just go ahead and blast them all blindly. With a little thought, blind replace-all will usually work with small code written very recently by you but will become increasingly error-prone with more code, more developers, over more time. You can, of course, try using case-sensitivity and whole-word search modifiers while trying to maintain naming conventions to keep replace-all working a little longer, but that's just an incomplete and buggy attempt at creating your own watered-down type system, not proving that types aren't useful.