if the problem is only with the
#define
and
const
, actually a const is better to make constants that will actually be USED in you program, but define is still usable in conditional compilation.
i actually have this style in programming: i write an algorithm, then decide its bad, so i delete it.
a few hours later i discover that the algorithm really needs just a little modification, and it becomes perfect, then i have to write the whole algorithm again.
with conditional compilation, i just enclose the algorithm in such line:
1 2 3 4 5
|
#ifdef _FIRST_WAY
algorithm
#else
rest of the program
#endif
|
this way, i don't have to delete the algorithm, just exclude it from compiling.
i think this is a good usage of C syntax.
if i'm wrong with something, please show me the right way.