When exploring a new codebase, what would be some methods of storing personal notes or annotations alongside the code? If I were the only maintainer, I might consider added an actual code comment into the code, but doing so in a team would just pollute the code and the git logs.
Ideally there might be something that is not editor-specific, but I'm open to editor-specific suggestions. I personally code in VIM 50% and JetBrains IDEs (With IdeaVIM) 50% of the time. Jetbrains has a Code Notes plugin, but unfortunately that plugin does not work with the current version of the IDE.
Example notes and annotations:
foo = get_foo(bar, boom); // Actually returns a proto-foo, not a foo
foo += 1 // Alice says this is to avoid the lochness bug
if ( !flashing ) brake_light = 1; // Bob insists on checking flashing in new code even though that feature has been deprecated for 17 years.
foo = processThing(foo); // TODO Figure out what side effects this has
doing so in a team would just pollute the code and the git logs
I strongly disagree. I think your excerpts are good examples of comments which provide context, and context can be a critical part of understanding business logic in code. All decent IDEs will highlight comments in a different color, which means they shouldn't make the code difficult to read.experiments\{username}
for people to put any random stuff of their own in. But also wish for what I think you're suggesting: Some way to have personal notes out-of-line from the code yet, somehow, magically, links between code<->notes updated as the code gets versions (so that they point to the same line, or same method, or whatever). Alternatively, some form of lightweight region marking similar to C##pragma region
except with IDE support so you could fold all but yours.