Java Backend Technology
Jan 16, 2021 · Fundamentals
Avoid Null Pointer Chaos: When to Use Null Checks vs Null Object Pattern
This article explains why excessive null‑checking in Java code is problematic, distinguishes between cases where null is a valid response and where it signals an error, and shows how returning empty collections or applying the Null Object pattern can eliminate redundant checks.
best-practicesdefensive programmingnull pointer
0 likes · 7 min read
