Changes between Version 22 and Version 23 of DeveloperGuidelines/CodeConventions


Ignore:
Timestamp:
06/21/11 14:35:44 (13 years ago)
Author:
Mike A
Comment:

Null handling

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/CodeConventions

    v22 v23  
    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, and dramatically increase the complexity of the code, making it harder to read and maintain.
     118Nulls make code much more complicated by introducing special cases that require special null-checking logic in every client, making code harder to understand and maintain. They often and easily cause hard-to-diagnose errors.
    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.