Why this matters
Prevents null/invalid states and clarifies invariants.
Set sensible defaults for properties/fields or enforce via constructors.
Prevents null/invalid states and clarifies invariants.
Side-by-side examples engineers can pattern-match during review.
public string Status { get; set; } // never setpublic string Status { get; set; } = "Pending";string Name {get;set;}string Name {get;set;} = string.Empty;From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.