4 ms·
So the common "refactorings" I see in IDEs now days tend to be things like rename, extract/inline, and a limited amount of class hierarchy change. Some of the
by travisgriggs 5y ago
So the common "refactorings" I see in IDEs now days tend to be things like rename, extract/inline, and a limited amount of class hierarchy change.
Some of the other one's I remember involved parameter add/removal (I think PyCharm can do this one?), extract to component, and high end ways to manipulate the class tree like add/remove/pivot class hierarchies.
There were some fun "extras" too like convert to/from ValueHolder (a ValueHolder is a Pointer with Notifications attached to it).
Where the magic began though was in this very simplicity all-in-one thing. To mess with the Refactoring engine in IntelliJs tools or VSCode, I have to learn another language, do another build environment. In Smalltalk, you were there already. It's all in the same code browser. Just scroll down to that part of the system. The AST is so simple, it's expressed in ~15 Node Types (compare to Ruby which has +90 parse node types someone told me?). The matching node type was a single additional node type. So you could see the code that did the refactorings. And you could use the same match trees they did. So you were minutes away from deriving your own refactorings. The first few times, it took longer than just doing them by hand, and then you got good at it and could do some cool things.
The only newer language that I've seen that maybe has this same "because we kept it simple we can do cool things" ethos to date for me is Elixir. My guess is there some others. My guess, is that like Smalltalk, any of these "mind blowing/changing" language/systems have a small but passionate following, but are not enjoying viral adoption.
- travisgriggs 5y agoTwo links of interest: https://refactory.com/refactorings/ https://refactory.com/refactorings/ https://www.researchgate.net/publication/220346807_A_Refactoring_Tool_for_Smalltalk https://www.researchgate.net/publication/220346807_A_Refacto...
- layer8 5y agoI see, the simplicity of the AST certainly makes it easier to add one’s own refactorings, and that’s quite compelling. Thanks for the pointers.
- igouy 5y ago> To mess with the Refactoring engine in IntelliJs tools or VSCode… https://www.jetbrains.com/help/idea/structural-search-and-replace.html#to_search_structurally https://www.jetbrains.com/help/idea/structural-search-and-re...