First, consider creating an editor / IDE that has the following functions:
- matching parsers / brackets / braces
- collapsing / expanding blocks of code between curly braces
- backlight type (in tooltips)
- macro extension (in tooltips or in a separate window / panel)
- function prototype extension (in tooltips or in a separate window / panel)
- quick navigation by types, functions and classes and vice versa.
- opening the same file in several windows / panels at different positions.
- look for all references / uses of a particular type, variable, function or class and presenting it as a list
- call tree / graphing / navigation
- regular expression search in addition to simple search
- bookmarks?
Source Insight is one such tool. There must be others.
Secondly, consider annotating the code when you go through it. When doing this, note (write down) the following:
- invariants (which is always true or should always be true)
- assumptions (which may be incorrect, for example, the absence of checks / validations or unreasonable expectations), think "what if"
- goals ( what ) of the code snippet
- implementation features / details (for example, whether exceptions are thrown and which error codes are returned and when)
- simplified call tree / graph to see code flow
- do the same for data stream
Draw charts (in ASCII or on paper / board); I sometimes take pictures of my paper or board. In particular, draw flowcharts and state cars .
Work with code at different levels of abstraction / details . Zoom in to see the details, zoom out to see the structure. Collapse / unlock code blocks and tree branches / call graphs.
Also, provide a checklist of what you are going to do. Check out the items you made. Add as needed. Prioritize work items if necessary.
A debugger is a program that allows you to execute your program step by step and check its status (variables). It also allows you to change state, and this can be useful sometimes.
You can use the debugger to understand your code if you are not very familiar with it or the programming language.
Another thing that may come in handy is writing tests or test data sets for your program. They can identify problems and limitations in terms of logic and performance.
In addition, documentation and people should not be neglected! If there is something or someone who can give you more information about the project / code, use something or someone. Ask for advice .
I know this sounds a lot, but in any case you will end up doing some of it. Wait for a big enough project. :)
source share