4 ms·
> you can just search one or two large ones. if the LOC is similar in size, i don't see why having them in different files vs same file makes any difference at
by chii 6y ago
> you can just search one or two large ones.
if the LOC is similar in size, i don't see why having them in different files vs same file makes any difference at all.
Also, your IDE should be able to navigate you to definitions and usages etc. If it doesn't, it's not a good IDE. So the problem of understanding code reduces understanding the abstract structure, not how that structure is represented on file.
- z3phyr 6y agoYour 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.
- userbinator 6y agoSearching in one file is easy in any text editor. Searching across files (and directories) is more difficult. I don't use an IDE. In fact, I'd say it's a problem if code requires an IDE in order to work on it effectively (Enterprise Java is the most prominent example of this.) I'm nowhere near Bellard level, but would consider myself above average, and have observed that some of the most productive programmers don't either --- and their code is far easier to understand than e.g. the mostly-autogenerated, split-into-many-tiny-files projects created by those far less skilled.
- brabel 6y agoTo suggest that not using an IDE is a sign you're a better developer makes as much sense as suggesting that not using an electric screwdriver to fit things is a sign of a better handyman.
- bitwize 6y agoTo suggest that GP could have written better software had he used an IDE is to suggest that Michelangelo could have painted a better Sistine Chapel fresco had he used an electric paint sprayer. Or, to bring it back within realistically achievable levels of talent, that Bob Ross's trees would've been happier if he used one.
- brabel 6y agoNo one suggested OP could do a better job had he used an IDE (and I have no idea if he did). The claim was that NOT using an IDE somehow signals you're a better developer, which is simply absurd. So your comparison is wrong in this aspect, as the correct comparison would be "Painters who do not use modern tools made specifically to make painting easier are probably better painters. Michelangelo was the greatest master and he did not use modern tools, after all". Would you agree with that??
- afiori 6y agoTo me it sounds like he/she was saying that mediocre programmers have to rely on IDE features and that various excellent programmer realized they can write better code without it. Before that the statement was that it is bad for project if a IDE in needed to navigate it. Maybe I am steelmanning too much but it could have simply meant to indicate the existence of a trend that move people toward IDEs and another trend that moves people away from IDEs