One of my university professors suggests using macros to reduce repetition in c99 code like this.
What can be used as follows:
for_ij { /*do stuff*/; }
for_i { /*do stuff*/; }
Another teacher with an industrial background discourages him from using, claiming that he was seen as an anti-pattern from his former employer (but he does not know the reason for this). In fact, using grepping through the source code of large projects, it is rarely possible to find these constructs outside of short academic examples.
My question is: why is this design so rarely used in practice? Is it dangerous to some extent?
source
share