I often review C/C++/... code (esp. my own). What I found effective to understand and review such code is to comment out each source code line (e.g., in case of C++, by prepending a supposedly unique comment marker (like '//!') to each line). I then uncomment the lines piece by piece after having understood what the author meant by a particular code snippet and if I think everything is okay. By that I work through the set of given files. Code (e.g., header files, functions, constants) that is still commented out afterwards might then possibly be removed.
However, I often want to "play around" with some of the code (e.g., rework a function and compile and run everything). For that, I obviously need to remove my comment marker from the lines that are still commented out. After the little test I then need to 'undo' the uncommenting.
Now to my question:
Is it possible in Vim to simply mark lines of a file visible somehow but not alter the file itself (so compiler, Make, ... see no difference unless the file was really edited). Such a mark should stay attached to its line if that line is edited or is moved within the file (e.g., if new code was inserted before that line or if code before that line was removed). Only if I decide so or if the line is removed, should the mark disappear. Newly added lines should be marked by default.