Changes between Version 22 and Version 23 of DeveloperGuidelines/CodeConventions
- Timestamp:
- 06/21/11 14:35:44 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines/CodeConventions
v22 v23 116 116 117 117 == 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.118 Nulls 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. 119 119 120 120 * 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.