4 ms·
I don't understand the point. Are you claiming that search and replace functionality provides the same ease of use as an actual rename refactor ? Foo x = new
by waps 12y ago
I don't understand the point. Are you claiming that search and replace functionality provides the same ease of use as an actual rename refactor ?
Foo x = new Foo();
int Fool = 5;
I'm sure you see the problem.
Dynamic languages are great, until the program grows. Then you hate yourself for having picked a duck/dynamic typed language (including Go, btw : programs become unmaintanable if they grow, not as bad as python and the like, but ...).
- desdiv 12y agoI don't understand the point. Are you claiming that search and replace functionality provides the same ease of use as an actual rename refactor ? No, I'm saying you need extra key strokes to activate that rename refactoring functionality, which is unnecessary in an ideal situation. To refactor the java code Foo x = new Foo(); you need to hit the key combo to active your IDE's refactoring thingy, then type the new name. To refactor a less verbose statically typed language: x = new Foo(); You just type over the old name, no refactoring key combo necessary. This discussion isn't about static versus dynamic. It's about useless verbosity versus less useless verbosity.
- waps 12y agoStill don't understand. Let's take the changes you need to make : Foo.java ... class Foo { ... } SomeOtherFile.java ... Foo x = new Foo(); ... Equivalent in Python: some_file_in_a_library.py class Foo: ... some_other_part_of_the_program.py: x = Foo() Keystrokes to change the name "Foo", in Java : 1) Position cursor on Foo. 2) Alt-shift-R "Bar" (+ enter) Keystrokes to change this name, in Python : 1) position cursor on Foo 2) Change to bar (5 or 6 keystrokes) 3) Open some_file_in_a_library.py (couple dozen keystrokes, most people I see do this have to switch to mouse and use that) 4) Change the classname 5) Go through all the unit tests that you should have that test the class (you need 5x more unit tests in Python compared to Java as well, to have equivalent tests), and do the same. Yes, all of them. Java wins out, by a factor of 3, maybe even 5. Even if the class definition and the usage were in the same file, it would still win by a lot. Refactoring simply doesn't work reliably in Python. Heroic efforts by Jetbrains notwithstanding, it just doesn't compare. So I don't see what you're complaining about. Making changes is only faster in Python in tiny programs, where you don't have the problem of interdependencies. As soon as you have some of them, Python starts losing out, bigtime.
- _lce0 12y ago..plus you need to know where the class is being used! Being able to refactor classes/methods/variables names without even care where those are used is a huge benefit IMHO