The pattern that spreads
The codebase I work in follows a structure. Every module has a BusinessEntities/ folder, a Components/ folder, a BusinessEntityCommands/ folder. Commands start with Command. Forms end with Form. En...

Source: DEV Community
The codebase I work in follows a structure. Every module has a BusinessEntities/ folder, a Components/ folder, a BusinessEntityCommands/ folder. Commands start with Command. Forms end with Form. Entity managers end with Manager. Delegates end with Delegate. Fifty modules. Same structure. Same names. Same methods. Nobody designed it. ## The archaeology of copy-paste Someone, years ago, wrote the first module. They created folders. Named classes. Chose <code>doExecute()</code> over <code>run()</code>, <code>declareOptions()</code> over <code>configure()</code>. These were choices. Not rules β choices. Then someone wrote the second module. They opened the first one for reference. Copied the structure. Not because it was optimal β because it existed. They renamed <code>Project</code> to <code>Invoice</code>, adjusted the fields, and pushed. The third module copied the second. The fourth copied the third. Somewhere arou