I just had this idea for something that I’d love to be able to use:
Let’s say I have to fix a bug and I decide to write an ugly code line that fixes the immediate problem – but only because I promise myself that I will soon find the time to perform a proper refactoring.
I want to be able to somehow mark that code line as "Expired in" and add a date – so that if the code is compiled some time after that date there will be a compilation error/warning with a proper message.
Any suggestions? It must be possible to perform – maybe using some complicated #IF or some options in visual studio?
I’m using VS 2005 – mainly for C#.
You could write comment lines in the form
and add a prebuild step which does a solution-wide replace of these lines by something like
for all lines that contain a date before the current day. For this prebuild step you would need to write a short program (probably using regular expressions and some date comparision logic)
This step could also be performed by a VS macro, which allows for easier access to all files fo the solution but has the disadvantage that it must be installed and run on all VS installations where your project is compiled.