Conditional Compiler Symbols
-
I'm working on a WPF app that uses conditional compiler symbols all over the place. Then, some bright spark decided that the best way to test all of these was to create a new project for each one that references all the same classes/files/view/viewmodels, etc, but with a different compiler symbol in the debug settings. 1. The #IF symbols are ALL OVER THE CODE. It's a mess. 2. There are multiple project files that simply exist to compile different logic paths based on the symbol. This all seems like a hack. Anyone have a better approach?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
I'm working on a WPF app that uses conditional compiler symbols all over the place. Then, some bright spark decided that the best way to test all of these was to create a new project for each one that references all the same classes/files/view/viewmodels, etc, but with a different compiler symbol in the debug settings. 1. The #IF symbols are ALL OVER THE CODE. It's a mess. 2. There are multiple project files that simply exist to compile different logic paths based on the symbol. This all seems like a hack. Anyone have a better approach?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
A more important question is : why does it need all these conditional compilations? To test them properly, you are going to need to have a new project for every possible combination, not just every symbol ... :~
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
A more important question is : why does it need all these conditional compilations? To test them properly, you are going to need to have a new project for every possible combination, not just every symbol ... :~
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
That's my point. I think they were trying to create different versions of the app. There's got to be a better way
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
That's my point. I think they were trying to create different versions of the app. There's got to be a better way
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
Disk space is cheap. RAM space is cheap. Simple IF-statements are cheap. OK, so changing the conditional compilation to run time tests could increase CPU load by half a percent. In extreme cases, the level of accusations of 'software bloat' may rise by as much as ten percent. Still, I think that is a better way.
-
That's my point. I think they were trying to create different versions of the app. There's got to be a better way
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
Have a look at this question: Extend base project to dedicated customer projects[^] - it's another guy with a similar problem, and trying to work out a solution.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!