Using macro as an abstraction layer
- by tehnyit
I am having a discussion with a colleague about using macro as a thin (extremely) layer of abstraction vs using a function wrapper. The example that I used is
Macro way.
#define StartOSTimer(period) (microTimerStart(period))
Function wrapper method
void StartOSTimer(period)
{
microTimerStart(period);
}
Personally, I liked the second method as it allows for future modification, the #include dependencies are also abstracted as well.