3 ms·
For my first few years programming I never used a statement of the form if ... else ... In late 1967, I taught myself to program. I never saw a computer during
by todd8 6y ago
For my first few years programming I never used a statement of the form if ... else ...
In late 1967, I taught myself to program. I never saw a computer during that time, but my high school owned a IBM 026 Keypunch machine used by the administration to enter data that was sent downtown to the school district that had a computer. I would use the keypunch machine to punch my program onto cards, one card per line of code. A friend of mine would pass them along to be run on the district’s computer.
The programming language that I had available was FORTRAN II. It had the arithmetic if and the goto but no modern if statement. The if looked like this:
IF (2*I - K) 25,35,55
Which meant compute the expression, if the result is negative jump to line with label 25, if result is zero jump to line of code with label 35, and if result is positive jump to line 55.
There were no Booleans, no comparison operators, and no modern control structures.
My very first attempt to program was intended to solve linear programming optimization problems using the Simplex algorithm, see [1]. The Simplex method finds optimal solutions to a multi variate linear expression, given a set of constraints expressed as inequalities on linear expressions over subsets of the free variables. I had read a slim book on the Simplex method and naively believed that it was a suitable first program. The turn around time submitting a program for me back then was about one week. Despite this ridiculous first attempt at programming, I scaled back my ambitions and wrote ten or twenty simple programs in FORTRAN without an else before going off to college to study mathematics.
It was a much simpler time to tinker with computers, I was excited to see my programs print simple tabular answers on fanfold paper.
[1] https://en.m.wikipedia.org/wiki/Simplex_algorithm https://en.m.wikipedia.org/wiki/Simplex_algorithm