A great blog written by Kent
- "Place code as close to where it's relevant as possible"
- "Things that change together should be located as close as reasonable."
- No one puts their comment in a separate file or directory, but have their comments co-located with the code they're explaining
- Modern frameworks puts your view logic and your view templates in the exact same file, for example React or Vue
- CSS-in-JS(A Unified Styling Language. In the past few years we’ve seen the… | by Mark Dalgleish | SEEK blog | Medium)
- co-locate our tests files with the file or group of files they are testing ⇒ we can see immediately that the module is tested
- Localize your state
- Performant ⇒ e-render a lot fewer components
- "Huh... I'll bet a lot of people could use this." ⇒ the component uses that util function is deleted, but the utility you wrote is out of sight, out of mind and it remains
- I will try to practice "Place code as close to where it's relevant as possible"
- I often have the situation where separating a function to utilities. I will think carefully from next time