Open SpiderMonkey1975 opened 7 years ago
Hi Mark, This is indeed the current code style (need link to code style here!) which says that guard clauses (what you have above) should be used. New code should be in the new code style and the old style should be converted as people work on routines/modules.
Further to the above, the current plan is to also group them such that we can #ifdef out the input argument check guard clause block if required for performance reasons.
Some subroutines have a fairly large number of association and allocation pointer checks that are implemented in a very deeply nested IF - ELSE IF structure. This can be hard to hard for developers and possibly difficult for compilers to optimize (when dealing with a high level of nesting).
A possible alternative is to conduct the checks in a series of sequential IF-THEN statements at the beginning of the subroutine. For instance:
Not an essential issue but maybe a coding style we could adopt as code is added and modified.