Re:Show HN: Imba – I have spent 7 years creating a programmi...
by cableshaft on Wednesday August 18, 2021 @09:43AM
(#28220824)
> You can use folder-by-feature structure alongside with separation of technologies, it's just not that common to see it
Angular is a pretty good example of this. The HTML, CSS, unit tests, and code are all in separate files, but they have the same base name and are grouped together in the same place.
The gist is that folder-by-feature is generally preferrable because it requires less context switching (in the literal sense of jumping between multiple different far away folders and scanning each for the thing you're looking for)
Single file components force you to organize code in a folder-by-feature structure, to a large extent. You can use folder-by-feature structure alongside with separation of technologies, it's just not that common to see it because the tooling to support it is not quite as optimized.
[0] https://softwareengineering.stackexchange.com/questions/3385...