www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How would you dive into a big codebase

reply "Freddy" <Hexagonalstar64 gmail.com> writes:
Is there any advice/tips for reading medium/big D codebases?
Oct 21 2014
next sibling parent reply "Jonathan M Davis" <jmdavisProg gmx.com> writes:
On Wednesday, 22 October 2014 at 01:21:19 UTC, Freddy wrote:
 Is there any advice/tips for reading medium/big D codebases?
I'm not aware of there being anything about D which makes it any different to dig into a large codebase than it is for any other language. The usual suggestion that I've heard given (without any particular language in mind) is to start by tracking down and fixing a bug in it, though if the codebase isn't too large for it, personally, I'd be highly tempted to just read through it all. I don't think very many people function that way though.
Oct 21 2014
parent "Nicolas F" <ddev fratti.ch> writes:
On Wednesday, 22 October 2014 at 02:09:53 UTC, Jonathan M Davis
wrote:
 The usual suggestion that I've heard given (without any 
 particular language in mind) is to start by tracking down and 
 fixing a bug in it
This is how I usually do it too, though you don't even need to find a bug in it. Picking any feature and trying to find it in the codebase and understand how it is implemented will usually serve well as an entry point. To understand all of the code, I'd start taking notes though, as they're useful to fall back on later. Either way, I wouldn't try to swallow all of it before starting to work with the code. I've been working on codebases just fine without understanding them in their entirety, as such is the magic of code separation. I'm pretty sure there are real codebases in the wild where nobody understands all of it. X11 comes to mind.
Oct 22 2014
prev sibling parent reply "safety0ff" <safety0ff.dev gmail.com> writes:
On Wednesday, 22 October 2014 at 01:21:19 UTC, Freddy wrote:
 Is there any advice/tips for reading medium/big D codebases?
Somewhat D specific: I would consider an IDE/editor like Eclipse with DDT that can give an outline of the data structures & functions names in a source file to make the files easier to digest.
Oct 21 2014
parent "Paulo Pinto" <pjmlp progtools.org> writes:
On Wednesday, 22 October 2014 at 02:42:38 UTC, safety0ff wrote:
 On Wednesday, 22 October 2014 at 01:21:19 UTC, Freddy wrote:
 Is there any advice/tips for reading medium/big D codebases?
Somewhat D specific: I would consider an IDE/editor like Eclipse with DDT that can give an outline of the data structures & functions names in a source file to make the files easier to digest.
This would be my approach as well. The code navigation options offered by modern IDEs are way better than the alternatives, specially the semantic navigation "what gets used where". -- Paulo
Oct 22 2014