#if NOT_USED
-
In my recent quests to solve an issue with legacy code, I found several places where code blocks are wrapped in #if NOT_USED ... #endif This is confusing to me since if NOT_USED is defined, then the code will be compiled into the project.
Phil
Indeed, should be
#if 0
or#if false
or something. -
In my recent quests to solve an issue with legacy code, I found several places where code blocks are wrapped in #if NOT_USED ... #endif This is confusing to me since if NOT_USED is defined, then the code will be compiled into the project.
Phil
Sounds like someone's not using version control on the source, or if they are, they are afraid of using the delete key to actually remove the code. I find this to be the least confusing way of ensuring that code is not compiled into a project. :)
Chris Meech I am Canadian. [heard in a local bar]
-
Sounds like someone's not using version control on the source, or if they are, they are afraid of using the delete key to actually remove the code. I find this to be the least confusing way of ensuring that code is not compiled into a project. :)
Chris Meech I am Canadian. [heard in a local bar]
Don't get technical with your new fangled ways. I'm just surprised he didn't use a hex editor on the compiled code.
Deja View - the feeling that you've seen this post before.
-
Sounds like someone's not using version control on the source, or if they are, they are afraid of using the delete key to actually remove the code. I find this to be the least confusing way of ensuring that code is not compiled into a project. :)
Chris Meech I am Canadian. [heard in a local bar]
I think the point is that
NOT_USED
could be defined at some point, and hose things up. -
I think the point is that
NOT_USED
could be defined at some point, and hose things up.You're correct and I understood that point. But, I see that my response could be mis-interpreted from that. For me, if I want to ensure that code is not compiled, I prefer to use the delete key and depend upon source control to preserve the code. :)
Chris Meech I am Canadian. [heard in a local bar]
-
You're correct and I understood that point. But, I see that my response could be mis-interpreted from that. For me, if I want to ensure that code is not compiled, I prefer to use the delete key and depend upon source control to preserve the code. :)
Chris Meech I am Canadian. [heard in a local bar]
Chris Meech wrote:
depend upon source control to preserve the code
Well, as long as it's not VSS.
Deja View - the feeling that you've seen this post before.
-
You're correct and I understood that point. But, I see that my response could be mis-interpreted from that. For me, if I want to ensure that code is not compiled, I prefer to use the delete key and depend upon source control to preserve the code. :)
Chris Meech I am Canadian. [heard in a local bar]
Yes, delete is good for the soul.
-
I think the point is that
NOT_USED
could be defined at some point, and hose things up.Actually the point is that there are many other ways to exclude code from being compiled, but using #ifdef NOT_USED creates confusion as to the intentions of the original developer. I prefer to be perfectly clear if I don't want the code compiled and either comment it out (with an explanation) or delete it entirely.
Phil
-
In my recent quests to solve an issue with legacy code, I found several places where code blocks are wrapped in #if NOT_USED ... #endif This is confusing to me since if NOT_USED is defined, then the code will be compiled into the project.
Phil
-
One year ago:
BOOL IsFalse;
...
IsFalse=FALSE;
...
if(IsFalse){
...
}:omg::wtf::eek::wtf::omg: :((:((
Russell
The programmer who wrote it must suffered from depression... I would rather use
IsTrue
- it's definately more optimistic, isn't it?Greetings - Gajatko Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
-
The programmer who wrote it must suffered from depression... I would rather use
IsTrue
- it's definately more optimistic, isn't it?Greetings - Gajatko Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
-
I think the point is that
NOT_USED
could be defined at some point, and hose things up. -
Actually the point is that there are many other ways to exclude code from being compiled, but using #ifdef NOT_USED creates confusion as to the intentions of the original developer. I prefer to be perfectly clear if I don't want the code compiled and either comment it out (with an explanation) or delete it entirely.
Phil