5 ms·
Your IDE should be able to split a single file codebase into different readable modules. If it cannot do that, its not a good IDE. And slippery slope...
by z3phyr 6y ago
Your IDE should be able to split a single file codebase into different readable modules. If it cannot do that, its not a good IDE.
And slippery slope...
- breck 6y agoIs there a term for this type of refactor? Often I might end up with 2 exported classes in one file, both being used across other files. I then want to separate them into 2 files and update the imports. I feel like my IDE should be able to do this, I just can’t seem to google the right term.
- breck 6y agoAh, in VS Code it is just: 1. Click class name (or any other top level identifier). 2. Click light bulb. 3. Click move to a new fie.
- terminalcommand 6y agoDo IDEs really do that type of refactoring? As a long time Emacs user I long forgot what a good IDE is capable of. I know of automatic renaming, moving parts you select automatically to another file, but full automatic refactoring to multiple modules is something I haven’t seen. How does this tackle circular dependencies etc. I guess the IDE must parse the code, generate the syntax tree, populate symbol tables etc. and then make the refactoring. A side point I sometimes dream of writing an emacs module which would let me to write in a single file (for easy search and edit reasons), and then cut it into several modules where I mark them with =======xyz.h========= etc. I also want to use this in each repo where it automatically does this. I’ll hopefuly stop procrastinating and write the thing one day :). To end with a Game of Thrones analogy, hearing about the latest developments I sometimes feel like we editor/linux/bsd/cli users are like Wildlings beyond the wall. We live in harsher conditions, but are amazed when we see large cathedrals, castles being built inside the wall. Our life is more free but also burdensome.
- chess_buster 6y agoI think that's actually a good analogy and I have felt the same from time to time!
- manigandham 6y agoYes. Modern IDEs are incredibly productive because they have a high-level understanding of your program, going beyond just symbols in the code and way above just text processing. Try using Visual Studio or Jetbrains IDEs and you'll see the difference.