Re:Code colocation is king
by jbreckmckye on Thursday February 03, 2022 @11:08AM
(#30194190)
You see, this is a design that's taken hold of a lot of codebases, and I don't think it works. I see a lot of projects with big folders mixing top level exports, implementation files, tests, test utils, fixtures and the like.
I'd much rather see the 'mirrored' approach.
> Random thought: Can the IDE recommend next file to work on
I'm _sure_ I've seen something like this in IntelliJ.
EDIT: I did! It's in the changes tab > the eye icon > 'show files related to active changelist'. It then sometimes will make suggestions based on project history.
Tests that involve complicated setup or are otherwise bigger than "unit" tests probably don't make sense to keep in the source tree.
But it's a nice idea to keep unit tests specifically alongside the "units" of code that they test.
Random thought: Can the IDE recommend next file to work on - “people who worked with this file, also worked on”. The real problem is not where we keep it, it’s how quickly we can get to it.