Look at this piece of code written in Algol 68, which finds the largest element of an array:
proc max = (ref[,] real a) real: begin real big := -maxreal co assign the maximum real number allowed co; for i from 1 lwb a to 1 upb a do for j from 2 lwb a to 2 upb a do if a[i,j] > big then big := a[i,j] fi od od; big end
It summarizes many of the things that were wrong with the language, and likely why it would have been a challenging language to teach people to program in.
- It uses a *lot* of acronyms. lwb is short for lower-bound.
- It uses control-structure terminators (for bracketing) that are the reverse of something in the beginning of the control structure… but not consistently. For example the for-do loop ends with od, and yet the if-then clause ends with fi. Shouldn’t that end in neht, or should the for loop end in rof? Not the smartest choice in the world.
There are elements of Algol68 that are inherently functional, however on the whole the language is mired by complexity. For example, consider the six forms of coercion (down from eight in the first report), something that would likely overly confuse the novice programmer: deproceduring, dereferencing, uniting, widening, rowing, voiding. Algol68 suffered from (i) being developed by committee – far too many people wanting far too many things incorporated into the language, and (ii) not being implemented widely enough, because implementation was a tricky process.
Check out this piece of code, which calculates a factorial:
Which is not exactly easy to read. Guess they didn’t care much about formatting either – not unusual for the time.
Reading a copy of the “Report on the Algorithmic Language ALGOL 68” might send you into a mild seizure, and even the Algol68 Genie learning guide is not for the faint-of-heart. I think if my first class in programming had involved Algol68, I would not have continued in computer science.
I think Algol 68 is summed up by this quote from Aldous Huxley in his book Those Barren Leaves: It is the great dead language of the future. By the time Algol68 made its appearance, there were other hounds already barking at the gates… simpler languages that would take the lead.