Feature flags (or toggles) are often utilized to power the visibility of caller features successful a product. There are a fewer different ways to instrumentality them, but the astir talked and marketed astir is to usage characteristic emblem guidance software. The simplest measurement of people is to hardcode them, though it’s the slightest written about.
While characteristic emblem guidance package can beryllium powerful, they are besides a root of complexity and risk. The blogspam trading down them is truthful strong, that admitting they’re unnecessary feels for illustration confessing to technological impotence. We’ve convinced ourselves that we don’t conscionable request a fewer characteristic flags, we request to standard to thousands of characteristic flags. And not conscionable that, but we will perfectly request to alteration a characteristic astatine runtime, and we perfectly must do it without a deployment, and without a restart, and without a cache flush, and without a database migration, and without a review, and without a trial because the business is connected occurrence and the only measurement to put it retired is to alteration the colour of the fastener connected the homepage.
The only flags that the capabilities of specified a strategy should bring up are of the #ff0000 variety. From an architectural perspective, they are small much than glorified if statements, managed successful a abstracted process. Often requiring their ain infrastructure, hosting, monitoring, and each the responsibilities that travel with.
From a improvement lifecycle perspective, they present non-deterministic behaviour, and make it harder to logic astir the code. Long lived characteristic flags, though initially good intentioned, lead to method indebtedness that ossifies the codebase; this consequence does beryllium pinch hardcoded flags, but it’s overmuch easier to spot and manage.
From a information perspective, they are a liability, arsenic the aboveground area for onslaught aliases vulnerability has now increased.
In immoderate case, adding much moving parts to immoderate package strategy should ever beryllium fixed scrutiny to spot if it’s really basal and whether the risks it introduces are worthy the problems being solved.
Hardcoded characteristic flags do distant pinch galore of these issues; they are simple, reliable, and safe. They are the astir boring measurement to do it, and that’s why they’re the champion measurement to do it.
Simply commencement pinch a elemental JSON file, publication it successful astatine exertion startup, and usage it to power the visibility of features. Keep connected apical of the flags, region them erstwhile they’re nary longer needed. If they unrecorded excessively long, make them the existent behaviour and region the flag. Change a worth done the normal improvement process, get it reviewed, tested, and deployed.
For astir teams and products, this will often beryllium bully capable and will person a batch of mileage. When a squad really gets to the constituent of needing to alteration a characteristic astatine runtime astatine scale, past overmuch for illustration authorities guidance successful SPAs, they’ll cognize they request it.
Premature optimization is not the measurement to go. It’s bad design, bad engineering, and only serves good for little moments of self-congratulatory smugness astatine tech conferences erstwhile the sales-speaker asks if anyone is utilizing them.
English (US) ·
Indonesian (ID) ·