3 ms·
In practice, the chances that N programmers with follow the pretty comment convention of a given file approach zero, as time passes. Splitting into files is an
by vemv 3y ago
In practice, the chances that N programmers with follow the pretty comment convention of a given file approach zero, as time passes.
Splitting into files is an approach that is easier to lint against (e.g. max 500 lines - a best-effort mechanism to foster SRP).
And it's not really problematic after mastering a few key aspects: jump to definition, and more interestingly Peek Definition.
It's also important to not traverse files top-to-bottom (which yes, is very tempting).
Optimal code traversal is tree-like, you jump from definition to definition, skipping over the irrelevant, and gathering necessary info on demand.
The file/line location of a function becomes irrelevant.
- solarkraft 3y ago> It's also important to not traverse files top-to-bottom (which yes, is very tempting). Optimal code traversal is tree-like, you jump from definition to definition, skipping over the irrelevant, and gathering necessary info on demand. A (successful!) ex-colleague of mine read thousands of lines long files top to bottom. I don't know how, but somehow this worked for them.
- vemv 3y agoYeah I mean, it can be done, it can be helpful but is it efficient? You could as well try memorizing the entire $framework API, which most people would agree that isn't the best use of one's energies.