#best practices
Posts tagged with “best practices”.
27 posts
Code Coverage Myths: What the Number Really Tells You
Coverage measures which lines ran, not whether they were verified. Learn what it is good for, what it hides, and how to use it sensibly.
A Code Review Checklist That Actually Helps
Good code review catches bugs and shares knowledge without slowing the team down. Learn what to look for, what to skip, and how to give feedback.
CSS Specificity Explained: How Conflicts Are Resolved
Specificity decides which CSS rule wins when several match. Learn the scoring, the cascade layers, and how to avoid specificity wars.
Debugging With Breakpoints: A Practical Guide
Breakpoints let you pause a program and inspect its state. Learn conditional breakpoints, watch expressions, and how to debug without print statements.
Dockerfile Best Practices for Smaller, Faster Images
A good Dockerfile builds fast and produces a small image. Learn layer caching, multi-stage builds, and the common mistakes.
DRY, KISS and YAGNI: Three Principles, One Goal
DRY, KISS and YAGNI are three heuristics for simpler code. Learn what each really means, how they conflict, and how to apply them sensibly.
Environment Variables: Best Practices and Pitfalls
Environment variables configure an application without changing code. Learn the patterns, the security rules, and the traps.
Error Handling Patterns That Actually Work
Good error handling is a design decision, not a try/catch afterthought. Learn patterns for propagating, wrapping, and recovering from failures.
Fixing Flaky Tests: Causes and Cures
A flaky test passes and fails without code changes. Learn the common causes, how to find them, and how to fix them properly.
Gitignore Patterns: How to Ignore the Right Files
A .gitignore is a set of patterns, and the rules are subtle. Learn the syntax, the precedence, and the mistakes to avoid.
Integration vs Unit Tests: What Each One Catches
Unit tests isolate one piece; integration tests verify pieces work together. Learn the trade-offs and how to balance the two.
JavaScript Dates: The Traps and How to Avoid Them
The Date object has real pitfalls: timezones, month indexing, and parsing. Learn the traps and the modern alternatives.
JavaScript Object Methods: A Practical Reference
Object.keys, entries, assign, freeze and the rest. Learn what each does, the shallow-copy trap, and the modern alternatives.
JavaScript Performance: Practical Optimisation Tips
Most JavaScript is fast enough. Learn where the real bottlenecks are, how to measure, and the optimisations that actually matter.
Logging Best Practices for Production Systems
Good logs make incidents short and bad logs make them long. Learn log levels, structured logging, what to log, and what never to log.
Mocking and Stubbing: Test Doubles Explained
Mocks, stubs, fakes and spies are different test doubles. Learn what each is for, when to use them, and why over-mocking makes tests brittle.
Naming Conventions: How to Name Things in Code
Good names make code readable without comments. Learn the conventions for variables, functions, classes and files, and the habits that produce them.
Property-Based Testing: Testing Rules, Not Examples
Property-based tests assert invariants that hold for all inputs, and the framework generates the cases. Learn how it finds bugs example tests miss.
How to Read a Stack Trace Without Panicking
A stack trace tells you exactly where a program failed and how it got there. Learn to read one top to bottom and find the cause fast.
Refactoring Basics: Improving Code Without Breaking It
Refactoring changes code structure without changing behaviour. Learn the core techniques, how to stay safe, and when to refactor.
Regression Testing: Making Sure Bugs Stay Fixed
Regression tests guard against old bugs returning. Learn how to write them, what to cover, and how to keep the suite from growing forever.
Rubber Duck Debugging: Why Explaining Code Finds Bugs
Explaining your code out loud often reveals the bug before you finish. Learn why it works and how to use it deliberately.
Test-Driven Development: A Practical Introduction
TDD is a short red-green-refactor cycle that shapes design as much as it verifies code. Learn the loop, the benefits, and the common objections.
The Twelve-Factor App: A Practical Summary
The twelve factors describe how to build a service that deploys cleanly. Learn each factor and what it means in practice.
Unit Testing Basics: What to Test and How
Unit tests verify one piece of behaviour in isolation. Learn what makes a good test, the arrange-act-assert structure, and common mistakes.
When to Write Code Comments (and When Not To)
Comments explain why, not what. Learn which comments earn their place, which are noise, and how to write ones that stay accurate.
Writing Clean Functions: Small, Focused, Testable
Clean functions do one thing, have clear names, and few parameters. Learn the rules, the trade-offs, and how to refactor messy functions.