View Single Post
  #144   Report Post  
Dave Hinz
 
Posts: n/a
Default

On Tue, 31 May 2005 20:28:19 -0700, Mark & Juanita wrote:
On 31 May 2005 20:54:07 GMT, Dave Hinz wrote:

On Tue, 31 May 2005 16:27:19 -0400, Norman D. Crow wrote:

I wasn't in the software end of the business, but 27yr. with NCR Corp. as
large scale system tech. produced a lot of funnies. First one was an
insurance company, program running solid for about 3yr. suddenly starts
blowing up, always at the same address. Turned out it was a situation which
original programmer knew could occur, but had never debugged!


You mean like the 9/9/99 date bug that I personally wrote into more than
a few applications? I mean, come on, who in their right mind would
still be using this POS in 15 years...


You mean you broke one of the first rules of programming? i.e, don't use
conditions that are possible, even if highly improbable, to terminate
loops. Or at least it was one of the first ones in our intro to
programming course when I was in college 20+ years ago.


I specifically remember being taught _to_ use 9999 as a terminator, to
say "We're done processing data now". I'm sure that that particular
terminator was responsible for more than that Y2K bug.

My first assignment out of college was designing and building automated
test equipment. I was assigned to a "senior" engineer, I think he had
around 8 years of experience :-) My assignment was writing the code to
control an eprom programmer, he was designing, building, and designing the
code for a much more sophisticated interface panel, designed to serve as an
interface between the system being tested and a controlling computer. He
had someone writing the assembler code for this panel to his design. When
I finished my assignment I wound up helping him debug the code and hardware
for the interface panel. While I had taken a modular, test a step at a
time approach to my design, this more senior guy took a more wholistic
approach, he had the first interface panel hardware assembled, did a
cursory visual power signal check, blew all 30k bytes of assembler code
into eprom, then turned on the panel expecting to get some sort of readout
on the front panel -- he didn't.


Ouch. I tend to over-test and iterate as I'm writing something, myself.
Makes the problem more immediate with less "Now WTF did I do wrong and
when" head-scratching.

It took several months of time to work
through the hardware errors before we even got to the point of having the
software start functioning.


Ow. Sounds like the run of multi-layer boards they had made, before
debugging the design. Turns out the component library had the wrong
info for a dual j/k flipflop - so all the resets were tied to the wrong
place through their resistors. I spent a non-trivial amount of time
making transparencies of the layers, tracing traces, and finding out
where I could drill which trace to get the right layer and not the wrong
layers, so I could avoid fly-wiring the whole damn thing. Engineer
never _looked at_ the design or he would have said "Hey, waitaminute,
you can't tie that there, it'll stay in reset all the time".

One of the funniest parts of the assembler code, he had a module of code
that had the comment, "should not have gotten here, set a flag so we don't
get here again".


I must remember that one, thank you. I've found old code of mine which
includes comments like:

# Now we're going to do (thing). I'm not quite sure just yet how I'm
# going to pull this off, so let's read on and find out together, shall
# we?

(And I just learned that this version of vi automatically continues
comment blocks by adding the # after a cr/lf. That's kinda cool...)

After he left the company, I inherited this monstrosity -- I convinced my
supervisor that it would be cheaper and better for all involved if I just
started over and redesigned the whole thing, hardware, code and all from
the ground up. My supervisor agreed. The resulting system did *not* have
any places where I set a flag to make sure I didn't get somewhere I should
not have gotten in the first place.


A total rewrite is hard to agree to, but when it's needed, it's needed.
We're re-writing something right now (ref: earlier death threats to
Sean), which unfortunately has to be done without breaking prod - but,
to the guy's credit, at least it's somewhat modular so we can fix one
chunk at a time, just keep the gazintas and gazottas the same.