-
@cramforce To some extent yes, if you have thousands of flags it means you have thousands of
if (flag)
which sounds pretty spaghetti. But if each flag is only ever used in one if-statement, then I would argue that's pretty well managed complexity. -
@cramforce I think the real spaghetti would be:
if (flag1) { if (flag2) doSomething(); else if (flag3) doSomethingElse(); else doSomethingElser(); }
And *that* is avoidable with keystones when used correctly.
-
@cramforce Actually a better example would be:
// foo.js if (flag) doSomething(); bar.doSomethingRelated();
// bar.js function doSomethingRelated() { if (flag) doSomethingElse(); }
The keystone pattern helps avoid flag usage like this to avoid that kind of spaghetti.