3 ms·
Try debugging a single 10k loc file versus fifty small modules where each takes care of a distinct part of the logic.
by montenegrohugo 5y ago
Try debugging a single 10k loc file versus fifty small modules where each takes care of a distinct part of the logic.
- userbinator 5y agoAs someone who did a bit of enterprise Java, I much prefer the former. Jumping around between lots of tiny files and not being able to see where the actual work happens because it's spread everywhere is a debugging nightmare.
- vonseel 5y agoI think you need a better IDE.
- tedunangst 5y agoBut what's the difference between file1.c ... file50.c vs cat file*.c > onefile.c?
- timando 5y agoI imagine the 50 files have meaningful names. Just kidding, no-one knows how to name anything.
- jokethrowaway 5y agoI'm not too bothered by the single 10k loc file (and I've seen plenty of files with thousands of lines). I would aim at files in the range of 200-300 LOC If you split it, it's crucial that you're splitting the logic in the right way (if the modules are too small, they'll just waste your time) and that you're making sure references can be easily traced (eg. if you have modules with some DI system which prevents references from being recognised, as it happens frequently in certain node.js enterprise applications).