Remove commented out code that is no longer in use
|Reported by:||Nicklas Nordborg||Owned by:||Nicklas Nordborg|
I think we should add a general rule to our code guidelines to avoid leaving commented out code in the files. The main reason is that it clutters the code, and it always give me a "headache" when I find it. Why was it commented out? Was it due to some temporary issue that is now fixed? Should the commented out code also be fixed?
I know that when I have been working on #1153 and #1597 I have commented out a lot of code because refactoring made in other places caused it to stop working as intended. The idea was to return later on and fix the code. It was simply to big to try to fix everything in one go. Now I find a lot of older commented out code and can't stop wondering if this is also code that should be fixed or if it can be removed. It's time for a cleanup.
In eclipse, the following regular expression seems to work well to find multi-line comments:
It will find code blocks starting with
/* (but not with
/**) that has a semicolon followed by a newline before the end-of-comment
*/ is found. The key here is that semicolon+newline makes it likely that the comment contains code. We should also try to find single-line comments