Comparison
Feature detectionvsFeature flag
Feature detection
you checked whether the API existed rather than checking which browser you were in.
Testing for the presence of a capability before using it, with `in`, a truthiness check, or `@supports` in CSS. It is the durable alternative to user-agent sniffing, which breaks whenever a browser changes its string or a new one appears. The failure mode to watch for is a partial or buggy implementation that passes the check, which is exactly what a badly written polyfill also creates.
Full entry →Feature flag
you ship the code turned off, switch it on for yourself, then for one percent, then for everyone.
A runtime switch controlling whether a code path is active. It separates release from deploy, enables gradual rollout, and gives you an instant off switch that does not require a deploy. Flags are debt: every one is a branch to test and understand, so each needs an owner and a removal date.
Full entry →