3 ms·
I get the impression that long files are culturally acceptable in systems-level C code. E.g., just a cherry-picked file from Linux: kernel/sched/core.c is over
by jvolkman 4y ago
I get the impression that long files are culturally acceptable in systems-level C code. E.g., just a cherry-picked file from Linux: kernel/sched/core.c is over 11k lines.
https://github.com/torvalds/linux/blob/master/kernel/sched/core.c https://github.com/torvalds/linux/blob/master/kernel/sched/c...
- cozzyd 4y agoyes are people using editors that don't let them have multiple views of the same file or something?
- colordrops 4y agoA filepath is an index and a hiearchy that adds information and structure. It can't be completely replaced by editor affordances.
- lillecarl 4y agoDepends on the language. C# somewhat replaces paths with namespaces, then you navigate classes and methods with editor tooling. I remember back when I was on Visual Studio writing C++ that they did something similar.
- bombcar 4y agoI feel the long file issue is mostly gone - that the problem isn’t the file length but spaghetti code. If it makes sense to be in one file it should be in one file. Breaking it up simply to reduce file length is counter productive.
- cperciva 4y agoThere are 18609 .c files in my checked-out copy of the FreeBSD src tree. The median length is 258 lines; 90% are 1373 lines or shorter; 99% are 5241 lines or shorter. The statistics for the 6071 .c files in the FreeBSD kernel are somewhat higher -- median is 460 lines; 90th percentile is 2070 lines; 99th percentile is 7678 lines -- but your example of a 11133 line file is definitely at the extreme high end.
- jvolkman 4y agoI didn't run any stats when I found that file. Just clicked around in github a handful of times looking for something that seemed like it'd be complex.