DEV Community

Discussion on: How to read others' code?

Collapse
 
torpne profile image
Kevin McKenna

Generally it tends to involve muffled screaming.. but for me it comes down to a couple of key approaches.

1) breakpoints. So many breakpoints.

2) comment the code yourself as you work through it.. if you can't work something out, leave a to-do and come back to it, but comment every live if you need to. Writing it down generally helps me get a grip in my mind of it.

Actually, my first go at it generally involves fitting it up on a closed test server and turning on a SQL trace and taking a look at the SQL that is hitting the database. From there I can generally understand a bit easier. Obvious exceptions of course