Changes between Version 21 and Version 22 of DeveloperGuidelines/CodeConventions


Ignore:
Timestamp:
06/21/11 14:34:30 (10 years ago)
Author:
Mike A
Comment:

Null handling

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/CodeConventions

    v21 v22  
    116116
    117117== Nulls ==
    118 Nulls make code much more complicated by introducing special cases that require special null-checking logic in every client. They often and easily cause hard-to-diagnose errors.
     118Nulls make code much more complicated by introducing special cases that require special null-checking logic in every client. They often and easily cause hard-to-diagnose errors, and dramatically increase the complexity of the code, making it harder to read and maintain.
    119119
    120120* Avoid returning nulls wherever possible. Unfortunately the design of python and web2py make this very difficult. E.g. if creating a data structure from many objects, instead of returning nulls from each object and requiring special checking before adding to the structure, pass the data structure to the objects and let them fill in as necessary.