| | |
Summary: Vol. 8, No. 6, SeptemberOctober 2009
Virtual Separation of Concerns
A Second Chance for Preprocessors
Christian K¨astner, School of Computer Science, University of Magdeburg,
Germany
Sven Apel, Department of Informatics and Mathematics, University of Passau,
Germany
Conditional compilation with preprocessors like cpp is a simple but effective means to
implement variability. By annotating code fragments with #ifdef and #endif direc-
tives, different program variants with or without these fragments can be created, which
can be used (among others) to implement software product lines. Although, prepro-
cessors are frequently used in practice, they are often criticized for their negative effect
on code quality and maintainability. In contrast to modularized implementations, for
example using components or aspects, preprocessors neglect separation of concerns,
are prone to introduce subtle errors, can entirely obfuscate the source code, and limit
reuse. Our aim is to rehabilitate the preprocessor by showing how simple tool support
can address these problems and emulate some benefits of modularized implementa-
tions. At the same time we emphasize unique benefits of preprocessors, like simplicity
and language independence. Although we do not have a definitive answer on how to
implement variability, we want highlight opportunities to improve preprocessors and
|