Configuration flags are where software goes to rot

27 points by josephjnk


wrs

My bumper sticker version of this is "every boolean config doubles the test matrix".

orib

This is the paradoxical reason that, in my experience, only supporting single character flags leads to better software. The individual flags are less scrutable, but the scarcity of good flags leads to care and parsimony in their usage, making the overall end result more usable.

fleebee

Agreed. It's tempting to tack in niche functionality and put it behind a flag, but now you've created one more thing for people to depend on. Odds are that flag will live on in the codebase and documentation for much longer than you expected.

You can see the effects in older software that has been maintained for decades. Try man curl at your own discretion.

singpolyma

I've started strongly considering 6 (slightly) different apps for 6 cases instead of one app with 12 knobs

mperham

Well said. Overlaps exactly with my experience too.

orib
Comment removed by author
tuxes

This gets worse when flags are not independent. One flag changes timeouts. Another one changes buffering. Another one changes concurrency. Individually, each sounds harmless. Together, they create a configuration space no one has actually tested.

Not only is it not tested, it's often not defined, because defining how all these flags interact is pretty awkward to do in prose. I find it's pretty difficult to reason about what most flags/configuration will do.

Sometimes when this happens, it feels like an off-the-shelf program is the wrong fit for the problem, and I'll try to find a simpler unit for me to compose, that's often one or two libraries. We can compose libraries with the might/precision of a programming language. Some libraries have the same issues re excessive flexibility, but there's typically suitable libraries for me to choose.

Sure, I have to write my own code, but that's often preferable to writing/maintaining an awkward integration in configuration. It's certainly more enjoyable!

What stops me? Sometimes I'm deploying to a system where deploying my own code is a faff, and "apt install nginx" (or whatnot) is my only practical option.