Comment

Comment by nomel

An IDE is aware of the structure/meaning of the code, giving in much more power.

sed absolutely cannot rename all the occurrences of something like a class method, since it would require deep dependency graphs to find all the class instances.

In an IDE, I can do something like this:

    # All three classes have a do_thing() method.
    my_instances = {
        1: Class1(),
        2: Class2(),
        3: Class3(),
    }

    my_instances[1].do_thing()
    my_instances[2].do_thing()  
    my_instances[3].do_thing()
In the IDE, I can rename the do_thing method for Class2, and it will correctly change the line "my_instance[2].do_thing()" to reflect the new name, leaving the others alone. This is not possible without something mostly indistinguishable from an IDE.
parent nomel 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton