4 ms·
It’s probably a mistake done after refactoring. The guy is only human you know.
by kabwj 7y ago
It’s probably a mistake done after refactoring. The guy is only human you know.
- V-2 7y agoMagic strings and numbers all over the place are less likely to be refactoring artifacts. Of course he's only human, but it wasn't me who picked this little (80 LOC) file, of all the codebase, as an example of code being like "out of a book or tutorial" :) And what about stuff such as 20 KLOC in a single file? This is spaghetti, no matter how you spin it. I wouldn't want to work with such codebase.
- smolder 7y agoJust because there are many lines of code doesn't necessarily mean it's badly organized, hard to navigate, or spaghetti like. People have this idea that high LOC files = bad. It's really complexity of mental model of code and difficulty of navigation that is bad. Repetitive code isn't elegant but it it's often more obvious.
- s_m_t 7y agoIt isn't really clear that splitting up your code into a bunch of files is always a good thing. Sometimes it becomes harder to search, for some people switching files incurs a sort of mental cost (like walking through a doorway), it can make compilation slower, and depending on your editor you might have to do some extra configuration to work well with your directory structure.