3 ms·
This is pretty similar to how I like to structure my code - basically by feature rather than by type. I find there's a lot less mental overhead to working this
by captainbland 8y ago
This is pretty similar to how I like to structure my code - basically by feature rather than by type. I find there's a lot less mental overhead to working this way, but it can bite you if you end up with a lot of code that is shared between features. Plus what a 'feature' is can be more subjective than what a type of class is and some teams might struggle because of strong, contrasting opinions on this.
That said, when a project gets big enough I tend to end up relying on memory and search (e.g. IntelliJ's find class) to find files anyway - at that point file name conventions are more important than anything else.
- slfnflctd 8y agoWhen you say "file name conventions" at the end there, are you simply thinking of the importance of being consistent in their usage, or is this a reference to something more specific?
- captainbland 8y agoConsistent in their usage, of course - it helps if, for instance, your tests have something referring to the fact that they're a test in the name. It's common for them to have 'UT' on the end so that when you do a search for "MyFancySomethingServiceUT" you can be reasonably confident it'll find your test.