Is it a good idea to implement business logic functions as macros?
I inherited some legacy C++ code and I find a whole lot of business logic functions are implemented as long cryptic macros.
Is there an advantage of macros over functions? What is the general rationale behind the use of macros?
What kind of logic is best suited for macros?
Here is a simple sample from code
#define INSERT_VALUES(IN,ID,EO) {\
double evaluationOutput = EO;\
int controls = 0;\
int input_controls = m_input_controls[IN];\
if(m_value_list[IN].ShouldProcess())\
{\
evaluationOutput = m_evaluationOutput[IN];\
controls = m_controls[IN];\
}\
VALUE_EXIST(evaluationOutput,controls,input_controls,IN,ID,Adj);\
m_evaluationOutput[IN] = controls > 0 ? evaluationOutput : 0.0;\
m_controls[IN] = controls;\
m_input_controls[IN] = input_controls;\
}