Re: [dev] saving program options

From: markus schnalke <>
Date: Mon, 25 Jan 2010 12:31:26 +0100

[2010-01-25 02:10] anonymous <>
> > TAOUP also recommends small programs that do just one thing. If you
> > have so many options that you need a "huge structure" to store them,
> > that might be a sign that your program is overly complex. Consider
> > factoring it into a set of smaller cooperating processes.
> It is not too big, but there are more than 7 options anyway. What
> about troff, for example? It is not very small and has more than 7
> options.

Mind the difference between accidental complexity and essential
complexity. (see ``No Silver Bullet'' by Brooks [0])


Troff's complexity is mostly essential. (In fact, it is one of the
best examples of how to avoid complexity, IMO.)

I don't know about your program. If the structures are ``huge'', then
you likely chose bad data structures. If they are large and the
problem is essentially complex, it might be okay. If the data
structures are huge, but the program(s) small, then you might want to
use global variables.

The advice is easy: Organize your code in a way to make it as simple,
clear, and general as possible. IMO, you may use global variables,
gotos, and other ``bad stuff'' without shame, *if* you have good
reasons for them. Or better: You *should* use this stuff if they help
you to make the code more simple.

Received on Mon Jan 25 2010 - 11:31:26 UTC

This archive was generated by hypermail 2.2.0 : Mon Jan 25 2010 - 11:48:02 UTC