Avoid Null
You can't make something out of nothing? Well, if you're an Agile-mentor-alist, then that's exactly what you do, but programmers shouldn't try to cash in on this skill. In programming terms, a nothing, or null, is of no use. They should be avoided. In particular, as they can sometimes cause crashes, they should be avoided at all costs, regardless of common sense. Here are some null-avoiding-patterns:
- Where the language allows reference types to be null use an irrational metaphor to guarantee non-nullness
- Replace null with zombies
- Replace optional parameters with every permutation of the function with fewer parameters, all mandatory
- Invent values
- Absorb all exceptions and pretend not to crash
0 Comments:
Post a Comment
<< Home