- 🚀 Team can move fast: reduced context switching
♥️ Developer experience: Code sharing, consistent tooling
-
Do not prematurely optimise. Do not create new file for a function that is not going to be shared by more than 1 file, only to clean up cluttered code. Keep related things together. Don't prematurely break a file into multiple files just because it looks cluttered. The best reason to declutter should be few functions are shared across multiple files. The file is very big 5K-10K lines of code, opening and closing takes time because it may clog up the buffer.
-
Do not group functionality based on the tech requirement. Group them based on business needs. In short term it will seem cool and clean but in longer term it becomes a bottleneck with a large team. The end goal of code organisation is that - when a new engineer joins, he/she must be able to grasp the business functionality just by plain reading the code.