Re: test if a string is a valid 'number'?
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Thu, 31 May 2007 09:11:44 -0400
My code does work, does sell, and doesn't require grotesque solutions. I can write an FSM
to parse an integer in less time than it takes to discover how to find a function in VB,
invent a way to call it, and create distribution package that includes the DLL. In fact,
I can write an FSM to parse an integer as fast as I can type it in.
The "need it NOW" approach has led to more bad decisions, some of which took MONTHS to
undo, and some of which cost us customers because the problems that resulted created code
that was unreliable.
The best possible solution would be an optimized FSM, but an optimized FSM takes too long
to write and doesn't matter when the unoptimized version can parse a number in under a
microsecond. But a kludgy solution remains a kludgy solution. The long-term implications
of code that is this bad are far more serious.
This violates the KISS principle: Keep It Simple. It adds unnecessary complexity to the
system, creating failure points that do not need to exist. The simplest one that should
be at the forefront of all decisions is "Will it run under Win64?", which this clearly
will not (The Win64 compilers do not support embedded assembler, and you can't call 32-bit
DLLs from 64-bit apps).
One company I worked for failed because management kept pushing for quick solutions, and
would not accept the time required to do correct solutions. I learned a lot about project
management from that company, mostly from antipatterns of bad management. I got a lot of
flak because I would not accept short-term kludges, yet my code didn't break. Everyone
who did quick & dirty solutions ended up having to rewrite their code again and again to
get it right. The result was a failure to ship (my code, for example, was running solidly
for a YEAR while the code around it got rewritten and rewritten and rewritten until that
particular project failed. During that year, I ended up rewriting several modules for
other people, and once rewritten, my code remained solid and required no support
whatsoever. Meanwhile, the quick & dirty code got rewritten yet again...)
I have no respect whatsoever for the kind of solutions that this code demonstrates,
because I've seen the ultimate consequences of these solutions, code that breaks far too
easily.
joe
*****
On Wed, 30 May 2007 22:25:27 -0700, "Ashot Geodakov" <a_geodakov@xxxxxxxxxxxxxxxxxx>
wrote:
Oh c'mon, you may write the most beautiful code in the world that won't workJoseph M. Newcomer [MVP]
and won't sell. While you spend time searching for the best possible
solution (which doesn't exist, by the way), customers take their business
elsewhere.
"It must work, and it must work NOW" is what I've heard thousand times...
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:0vds53l3v1g69sbitss72g5l11lmmeraeo@xxxxxxxxxx
"It works" is one of the weakest justifications for bad code I have had to
put up with in
my career. Not only is the solution baroque, horribly inefficient, and
non-portable, to
start with its major flaws, but is completely unnecessary because you can
write the FSM
parser in a fairly minimal amount of effort, vastly less effort than was
required to
conjure this off-the-wall solution!
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: test if a string is a valid 'number'?
- From: Ashot Geodakov
- Re: test if a string is a valid 'number'?
- References:
- Re: test if a string is a valid 'number'?
- From: Ashot Geodakov
- Re: test if a string is a valid 'number'?
- From: Doug Harrison [MVP]
- Re: test if a string is a valid 'number'?
- From: Ashot Geodakov
- Re: test if a string is a valid 'number'?
- From: Joseph M . Newcomer
- Re: test if a string is a valid 'number'?
- From: Ashot Geodakov
- Re: test if a string is a valid 'number'?
- Prev by Date: Re: test if a string is a valid 'number'?
- Next by Date: Re: test if a string is a valid 'number'?
- Previous by thread: Re: test if a string is a valid 'number'?
- Next by thread: Re: test if a string is a valid 'number'?
- Index(es):
Relevant Pages
|