What problem does it solve?
Defensive programming patterns often hide errors, fabricate data, and allow silent failures that make bugs harder to detect and fix; this guide helps reviewers and developers identify and replace those anti-patterns with fail-fast, honest behavior.
Core Features & Use Cases
- Detection of anti-patterns: Highlights common issues like swallowing exceptions, fabricated defaults, unnecessary null checks, type coercion, compatibility shims, and catch-all handlers.
- Guidance for remediation: Recommends fail-fast replacements such as raising explicit errors, validating at boundaries, and trusting internal contracts.
- Use cases: Code review checklists for PRs, automated review prompts for LLM assistants, and team training on safer error-handling practices.
Quick Start
Ask the assistant to review the provided function for defensive programming anti-patterns and recommend fail-fast replacements with specific code changes.