When modify code, our company requires us to add some sort of "Code Mark" and have the original code commented out instead of directly remove/modify them.
For example, original code:
*pRetNumber1 = nResult1; // validity checking missed
*pRetNumber2 = nResult1; // bad Copy & Paste here
Updated code:
//-- CODE_MARK_BEGIN, date here, author's name here, ...
//*pRetNumber1 = nResult1;
//*pRetNumber2 = nResult1;
if (pRetNumber1)
*pRetNumber1 = nResult1;
if (pRetNumber2)
*pRetNumber2 = nResult2;
//-- CODE_MARK_END
To do this job I will have to:
1. Select the code block.
2. Comment out the original code.
3. Select the code block again.
4. Either press a key or use VA's menu to add "Code Mark" by VA Snippets.
5. Add modified code.
So, I wonder if VA could provide a way to comment out things like $selected$ in VA Snippets, like this:
//-- CODE_MARK_BEGIN, $DATE$, Kenny
{CmtBegin} $selected$ {CmtEnd}
//-- CODE_MARK_END
{CmtBegin} and {CmtEnd} here are tags to indicate what to be commented out, and also it'd be better if VA could use single line (C++) / multi-line comment (C) base on the number of lines of $selected$.
Regards,
Kenny