Artificial Coupling

Placing constants/enums/functions/variables in code where it is convenient instead of logically located. This is lazy - discipline yourself!

static datatype myGeneralHelperFunction(item) {
    ...
}

void MyUnrelatedClass::internalFunction() {
    equation_result = myGeneralHelperFunction(item);
    ...
}

The general helper function should be moved as an internal class function if its actually related to the class; otherwise it should be extracted into related utility functions or its own file - this makes it easy to use if it ends up being useful elsewhere!



bj 2019-09-22