3 ms·
> Try unravelling that tangled, buggy mess, which looks more like a bowl of angel hair pasta than a finely tuned piece of programming. Industry best practice wo
by shock 6y ago
> Try unravelling that tangled, buggy mess, which looks more like a bowl of angel hair pasta than a finely tuned piece of programming. Industry best practice would have 500 separate files instead. In our commercial reality, we would fire anyone for developing code like this and any business that relied on it to produce software for sale would likely go bust.
Having the code in more or fewer files is orthogonal to how tangled the code is. Files are just containers for classes/functions. In most cases it makes no difference to the architecture of a system over how many files the code is split.
> The approach ignores widely accepted computer science principles known as "separation of concerns", which date back to the early 70s and are essential to the design and architecture of successful software systems. The principles guard against what developers call CACE: Changing Anything Changes Everything.
Again, one doesn't separate concerns over files. You can have code split over 500 files and still have a very nasty case of CACE.
> Without this separation, it is impossible to carry out rigorous testing of individual parts to ensure full working order of the whole. Testing allows for guarantees. It is what you do on a conveyer belt in a car factory. Each and every component is tested for integrity in order to pass strict quality controls.
At the lower levels, one tests functions or classes, not files, so I don't get the argument he is trying to make that the code is not split in enough files.
- qeternity 6y agoI agree that some of these distinctions are correlative, not causative, but I think the number of files argument is valid for one reason: navigation. Files are effectively pointers to ranges within a code base. Without them, you’re left jumping through a huge codebase by searching or scrolling.
- shock 6y agoEven in languages with one class/file convention I find navigating using the IDE's symbol search functionality preferable to navigating using files – especially in huge codebases. YMMV.
- qeternity 6y agoI don’t disagree if the language is OO such that classes have reasonable functionality contained within them. But searching through many many functions because very disorienting. Just my $0.02 of course