Best-Practices
21 posts
The Shape of a Pull Request You Can Trust
Six sections that let a reviewer believe a diff without reproducing the work, including the two most people leave out, a mutation check and a "not done" list.
Trusting X-Forwarded-For Is How Rate Limiting Quietly Stops Working
If you read the leftmost X-Forwarded-For value, the client picks its own identity and a rotating header defeats your limiter entirely. Count hops instead.
Prove the Test Can Fail: Mutate the Fix
A regression test is unverified until you have watched it fail against the unfixed code. The procedure, and three shapes that survive a naive check.
Running GitHub Actions Efficiently
A macOS runner costs ten times a Linux one, and that multiplier reorders every other CI decision. How to cut Actions minutes without weakening the gate.
Managing Bandit False Positives Without Breaking Security
How to handle false positives in Bandit without accidentally silencing the real vulnerabilities hiding among them. A practical guide.
Verification and Validation: Building the Right Thing Right
The difference between verification and validation, and why software teams should care about this systems engineering distinction.
Refactoring Library Interfaces
Discover techniques for improving library interfaces through thoughtful refactoring, using real-world examples while maintaining backward compatibility.
Context-Aware Library Design: Build for Your Users
Learn to design Python libraries that adapt to various user needs and experience levels, ensuring simplicity and effectiveness for all users.
Handling Deprecation: Gracefully Retiring Features
Learn to deprecate Python library features gracefully with warnings, clear communication, and migration paths that minimize disruption to your users.
McCabe Complexity: The Python Metric You Should Care About
Learn about McCabe Complexity, a key metric for code complexity. Understand, measure with tools like Ruff, and manage complexity in Python projects.