Introduction to Computer Programming
In 1966 in the last year of my secondary schooling, I had the great fortune to be able to attend a week-end camp for science students, addressed by a number of scientists from a range of disciplines. One speaker that caught my attention, spoke about computer programming and introduced us to FORTRAN-2. After less than 2 hours learning, I wrote a short program on coding forms, which our lecturer took back to his office that night, punched onto (Hollerith) cards and ran on his work computer, bringing the output listing back the next day.
The Program
I had chosen to compute and list the surface area and volume of a series of spheres over a range of diameters.
The Bug
The astute/experienced programmers will have probably guessed the bug already. Yes, I had used a floating point variable as an iterator with an equality test for loop termination. So of course my loop never terminated and my program ran for the full 2 minutes time allocation with a couple of hundred pages of output.
The Lesson
I hadn't learnt yet about about the imprecision of representing real numbers in finite binary form. The lesson was not just about the limitations of numerical representation, but that computing is a harsh master, so fastidiously precise that it is almost dumb. I had learnt that software engineering spans theory (mathematical logic of algorithms) and experiment - that to err is human and the norm - that the job's not finished until the inevitable errors are found and debugged.
If I had not made that first mistake, I wouldn't have learnt much!