A
Arved Sandstrom
In this particular situation, even if the code is throwaway testingGiven that most of the parsers I deal with are lengthy recursive-descent
parsers, I assumed that there would have been a distinct parser object
that handled the lexing and parsing itself and furthermore that two
parsers would want to be in two separate classes. Also, since the
question was asked with the purpose of timing, I presumed that it was
fairly large and complicated parsers that were being tested for the
purpose of determining the more efficient one. As a logical consequence
of these assumptions, I would have assumed that the natural way to
implement this code is as objects, hence my surprise to not find it
implemented in such a manner.
Of course, all of this relies on my assumptions being correct.
stuff, implementing it your way is either the best decision or a good
decision. After all, it's not exactly a complicated OO problem.
My point was simply that if this *is* back-of-the-envelope test code,
that using interfaces etc is not necessary. It's not inadvisable - it's
just not _needed_.
Don't mind me - the last few years I've been questioning dogma. All of
it.
AHS