
Publisher on askill
Use when component does too many things. Use when mixing data fetching, logic, and presentation. Use when code is hard to test.
Use when designing interfaces. Use when implementing interfaces with methods you don't need. Use when forced to implement throw/no-op for interface methods.
Use when writing similar code in multiple places. Use when copy-pasting code. Use when making the same change in multiple locations.
Use when acquiring multiple locks. Use when operations wait for each other. Use when system hangs without crashing.
Use when creating subclasses or implementing interfaces. Use when tempted to override methods with exceptions or no-ops. Use when inheritance hierarchy feels wrong.
Use when handling errors. Use when tempted to catch and swallow exceptions. Use when returning default values to hide failures.
Use when tempted to add features "for later". Use when building "production-ready" systems before needed. Use when adding flexibility that isn't required yet.
Use when designing or modifying APIs. Use when adding breaking changes. Use when clients depend on API stability.
Use when exposing internal state. Use when making fields public for convenience. Use when external code modifies object internals.
Use when adding new functionality to existing code. Use when tempted to add if/else or switch branches. Use when extending behavior of existing classes.
Use when loading all data upfront. Use when initial page load is slow. Use when fetching data that might not be needed.
Use when creating mutation endpoints. Use when trusting frontend to prevent duplicates. Use when payments or critical operations can be repeated.
Use when working with API keys, passwords, or credentials. Use when asked to hardcode secrets. Use when secrets might leak.