4 ms·
The first programming language I used was WATFIV, a Waterloo FORTRAN implementation. It seemed straightforward, and if that’s all there was to programming, I pr
by braythwayt 11y ago
The first programming language I used was WATFIV, a Waterloo FORTRAN implementation. It seemed straightforward, and if that’s all there was to programming, I probably would have dropped it in 1974 to play more D&D. FORTRAN felt like the same arithmetic I already knew how to use. It was obviously way more powerful to use a program to do calculations, but it was all stuff I could have done by hand or with a calculator.
But one day, as I waited for a keypunch to make some changes to some program or other I was writing, my eye fell upon a copy of the Green Book left behind by some other programmer. I started reading it, and my little mind was completely blown.
SNOBOL was something else, it forced me to think about programs in a completely different way. It wasn’t about specifying steps to be taken one by one, it was about designing a way to pattern match.
And more than in the obvious, RegExp way, but you could do things as the pattern was matching, and thus you were writing a kind of program where the control flow was determined my backtracking and success or failure of matches.
To this day, my programming is highly influenced by one feature of SNOBOL, I guess it “imprinted” on me: Patterns are first-class values (like regular expressions in other languages), but they are also composable, there is an arithmetic of patterns. To this day I favour designs where things can be composed and decomposed at will rather than used as opaque, monolithic entities.
I’m not saying SNOBOL was better than the FP and OOP and multi-paradigm languages that dominate today, but the experience of learning a new way to think was intoxicating, and once a year or so I re-read the Green Book and think about thinking differently.
If you are interested, I highly recommend you read the whole book. If you see “pattern matching” and think “Regular Expressions,” you will miss the forest for the trees. I’m not sure that anybody needs to know SNOBOL (or its descendants), but I think that it’s a valuable exercise to learn it once.
"A language that doesn't affect the way you think about programming, is not worth knowing.”
--Alan Perlis
- Zuider 11y agoThe Green Book you mention is available for download on the Google Code page for SPITBOL: https://code.google.com/p/spitbol/downloads/list https://code.google.com/p/spitbol/downloads/list