Learning A Codebase

Responding to my post on internships a student asked me:

Q. Reading Code

What’s the best way to learn a new codebase?

A. Read With Purpose

Good question.

Identify a simple modification you would like to make. Learn enough to make that modification.

If you can’t make the modification after an hour of reading code, stop. Come up with something simpler based on what you have learned so far. Repeat this process until you successfully make a predictable change in the system.

Now that you have a grip on the code base start leveling up. Identify a slightly larger change. Give yourself a small deadline for achieving it. No longer than one hour. Keep leveling up the modification you are making until it gets to a level that is useful.

Remember:

  • Don’t start with a small useful modification — just a small observable modification.
  • Keep yourself on a tight leash. If you miss your short deadlines, make smaller tasks with shorter deadlines. Simplify until you gain purchase.

Above all, reading code is like any other skill. Do it more and you get better at it. Stop doing it and your skill erodes.

I hope that helps you.

By Tyler Peterson

Web Developer and a hiring manager at an established technology company on Utah's Silicon Slopes in Lehi.