[getopt-sig] there isn't really any discussion here

Russ Cox rsc@plan9.bell-labs.com
Wed, 13 Feb 2002 13:24:50 -0500


What I've learned from getopt-sig is that the world appears to be
divided in two.

In one camp, there are people who believe that the argument parser
should be helping to manage the complexity of the program, believe
that the current getopt does too little, believe that objects are the
solution to the problem, believe the argument parser should include a
grab bag of helper functions to do everything you could imagine
wanting, and aren't bothered by the complexity of the whole approach.
This camp seems quite large, or at least vocal.  Perhaps that's in
part because the creation of getopt-sig was announced on optik-users,
but not entirely: there are so many object-based argument parsers out
there that there must also be plenty of people who believe this is the
way to go.

In the other camp, there are people who believe that the argument
parser should be parsing arguments and doing little else, believe that
the current getopt does too much (mainly because it requires
specifying the argument set twice), and believe that writing a for
loop over the arguments is convenient and even preferable.  This camp
seems quite small, or at least quiet.  The only people who have spoken
who might fall into this camp besides me are Paul Prescod and
Martin v.  Loewis, neither of whom has joined getopt-sig.

It's not clear that one group is right and one group is wrong.  I
think it's basically a difference of opinion about what constitutes
the best approach to the problem.  Unfortunately I don't see any good
way to sate both groups simultaneously.  I am ready to admit defeat.
Perhaps it is worth having both approaches in the standard library, as
IterGetopt and ObjectGetopt, or something like that.  Perhaps not.

I admit to being somewhat disheartened by the recurring cries for
supposed features like ``optional arguments'' (which introduce parsing
ambiguities) and ``mandatory options'' (a contradiction in terms).

I did gain something from all this, namely that I now have an
argument parser that is simpler to use than the current getopt.
Now I won't need to consult the getopt documentation every
time I write a main() function.  For that I am quite grateful.

Russ