TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

What are your strategies for diving into a large, complex codebase?

15 pointsby InformalReliefover 11 years ago

4 comments

sdegutisover 11 years ago
The trick I've used in the past is to start by tackling a single, small, isolated feature change. After you finish it, start with another one that's related to this one. Keep doing it until you've covered the whole codebase, making sure to only do small ones! This trick doesn't work.
yawzover 11 years ago
Michael Feathers&#x27; <i>&quot;Working Effectively with Legacy Code&quot;</i> is a great book that I would recommend for such situations.
评论 #7182586 未加载
评论 #7180229 未加载
SkyMarshalover 11 years ago
In a nutshell, find the main&#x2F;entry method, then walk the tree from there. That takes you from most general&#x2F;big picture to most specific&#x2F;granular and helps in mapping out the structure.<p>Obviously for big code bases you can&#x27;t do it all in a day, but just having a big picture model in my head when I resume on subsequent days helps fit it all together.
osivertssonover 11 years ago
If you are lucky enough that the large and complex codebase has extensive system-level and unit-tests, then that is where I would start.<p>Hopefully it is easy to get the codebase up and running so that you can explore it hands-on and try both happy-path cases and what happens when things go awry.<p>Walk through a feature of the code manually or step through it using a debugger while drawing boxes on how stuff fits together, and what the main building blocks are.<p>It will always take time to really understand a new large and complex codebase. If it is high-quality code it is easier, if you have experience with similar products it is easier. But to really feel that I grasp the really good parts and the dark and dangerous corners of a new codebase always takes me months.
评论 #7182555 未加载