User Tools

Site Tools


whyflagsarenolongerviable

This is an old revision of the document!


Why I Abandoned Flags

From a programming perspective, the functionality provided by directives is not much different than that proposed by the flag model. Both aim to modify the default behavior of the ParserMonster Framework.

Directives are more suitable than flags for the simple reason that flags imply a limited pair of options: True or False (or Set / Reset, On/Off, Yes/No, etc.)

Flags might interfere with each other. Consider the ReadFrom box on the Main Window. ParserMonster allows for the source files to come from drag and drop, the folder browse dialog box or a list file (from another program's output, for example). The way the framework handled flags, if each source had its own flag, nothing prevented a task from setting more than one of them.

With directives, the framework will obey the last one detected. Simple.

Finally, directives are easier to code and maintain. Flags would have proliferated all over the framework as each module checked an increasing number of options.

whyflagsarenolongerviable.1407523220.txt.gz ยท Last modified: 2014/08/08 18:40 by Mitch