Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm a junior developer and am trying to learn by reading open source code (AutoMapper).

My approach would be to first understand the requirements of the software/feature. Then look for specifics on how each requirements were implemented and dive deeper into the code until I've reached the end. I would reiterate until I've covered each requirement.

I understand my question does not have a "best" answer. Please give me some input on what works for you guys. Thanks!

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You will have several problems with that approach. First of all, requirements are very rarely (if ever) in one place and very rarely written in stone. You will not be able to find all the pieces of the puzzle and the pieces you find might be out of date.

Your best bet is to understand the 'requirement' on the class or method level. Most open source projects have good documentation on the source level. Once you read the documentation of the method or class, then start looking at the code and see how they try to implement it.

Another good exercise would be to look at the code and work backwards. Read the code and write down what the code does at a high level (pseudo code). Then look at its documentation and see how close you figured out what the method/class does.

These are good exercises when code is written well. If it is written badly, you can very quickly get overwhelmed and it can also teach you bad practices. You are lucky though, as most open source projects are tend to be written well especially when you have more people collaborating on them.

share|improve this answer
1  
Even worse, for open source, requirements rarely exist at all, and the only documentation is often the JavaDocs or equivalent. If I had a nickel for every open source file I've read where the only comments were the BSD, GPL, or Apache license header, I wouldn't have to read code :-) –  Ross Patterson Dec 14 '11 at 1:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.