Learning and Maintaining a Large Inherited Codebase?
An anonymous reader writes "A couple of times in my career, I've inherited a fairly large (30-40 thousand lines) collection of code. The original authors knew it because they wrote it; I didn't, and I don't. I spend a huge amount of time finding the right place to make a change, far more than I do changing anything. How would you learn such a big hunk of code? And how discouraged should I be that I can't seem to 'get' this code as well as the original developers?"
30-40K is nothing. One person should be able to handle that easily. Although I can imagine for an inexperienced programmer it can be too much. I remember the first 'large' program I wrote in school -- it was 400 lines.
10 years ago I had to port 1.5 million lines from one UNIX to another. Well that's a large project.
Anecdota from the 2.6.13 source tree: ./drivers/usb/media 28846 ./net/ipv6 28901 ./fs/jfs 29103 ./fs/reiserfs 29268 ./mm 29446 ./drivers/usb/gadget 29453 ./drivers/char/drm 31944 ./drivers/scsi/aic7xxx 32463 ./drivers/isdn/hardware/eicon 33054 ./drivers/atm 33462 ./arch/alpha/kernel 34150 ./drivers/net/sk98lin 34598 ./drivers/ieee1394 34683 ./arch/i386/kernel 35251 ./arch/sparc64/kernel 35293 ./arch/ia64/kernel 36738 ./drivers/usb/serial 38002 ./sound/pci 38576 ./kernel 39278 ./drivers/video/console 39445 ./drivers/pci/hotplug 39969
None of these, by any measure, are large