3 ms·
Still don't understand. Let's take the changes you need to make : Foo.java ... class Foo { ... } SomeOtherFile.java ... Foo x =
by waps 12y ago
Still 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