Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Whenever working with a new codebase I always try to find the route definitions file first. Something that maps the api interface to the functions they call. I can then reason backwards from any service by clicking into whatever I’m interested in. After that I look for where config is defined and try to understand what’s unique about this envs setup.


I like this approach because it keeps the fact that code is supposed to DO SOMETHING front and center. There is so much temptation (and many excellent reasons) to organize code in various ways but I think the power of route-based thinking should not be underestimated. Obviously depends on what you're building, but for most web-apps, I would trade some code duplication for very clear "this-does-that" organization.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: