CodeSOD: The Error Check Note

CodeSOD: The Error Check

The codebase is primarily written in C, where function return values typically indicate status codes. The standard convention is to check if a boolean return value is true for success. However, a long-time developer introduced a confusing alternative idiom. This developer checks if the boolean return value is false to signify an error. This practice has become the prevailing convention within the project due to the developer's tenure. Consequently, any potential error condition involves checking if a variable named 'error' is equal to FALSE. While consistent within its own framework, this convention is not formally documented. New developers often initially adhere to the standard pattern. However, the sheer volume of existing code with the non-standard pattern influences them. This established codebase possesses a strong inertia that shapes new code. The existing code effectively dictates the development style, rather than developers altering the code.