There are only 3 programs

In another place:

My reply there was complaining about sloppy or lazy programmers, however it did remind me of something a lecturer said many years back while I was at uni;

There are only 3 programs:

  1. The Input and Validate
  2. The Update
  3. The Report

And while this was really aimed at COBOL programming at the time (very early 80s), I do wonder just how true that still is today in other languages and systems and that maybe we’ve forgotten?

Sensors → (MQTT) Database → Display

Hours worked → Update Payroll → Print Cheque

I get the feeling that the validate is missing a lot of times - a recent example I noticed was viewing vehicles on ebay - Mileage: NaN. What does that tell you? The Input wasn’t validated or the Display wasn’t checked for an invalid (or more likely missing in this case) value? (And what’s the side-effect of a missing value when updating the database?) And similarly we read about utility companies sending bills for 100x the expected amount, or a much worse example might be the Horizon/Post Office scandal:

where at least one person died through suicide as a result.

Sloppy/Lazy programming? You decide…

-Gordon

1 Like

My personal impression is that input validation is the least loved part of programming (possibly including documentation). However, it is probably the most important one, since, as the display/report enjoys all the care and love, what are you actually displaying?
And, as exemplified by the BPO scandal, there are real consequences.

2 Likes
  1. the test program. Does it work like you expect? Do you run out memory?
    Is the algorithm correct? Did somebody break something outside your program.
    Did some idiot install a different OS version or DLL.
    Ben.
    PS I am composing dummy email and use the spell checker there, and then paste
    here.