4 ms·
In high school I thought "structured programming" would cramp my style. I'd spend hours with BASICA printouts spread out over the floor, tracing through chains
by DennisP 3y ago
In high school I thought "structured programming" would cramp my style. I'd spend hours with BASICA printouts spread out over the floor, tracing through chains of GOTOs to find my bugs.
One day my dad brought home Turbo Pascal so I gave it a shot. I wrote Conway's Game of Life, and was shocked when it ran correctly the first time. Never wrote another line of BASICA.
Much later I turned pro and moved on to other languages, but my dad kept messing around with Pascal until he was in his 70s.
- zozbot234 3y ago> was shocked when it ran correctly the first time This overall "if it compiles it works" philosophy is quite common among Pascal-family languages, and derived languages like Ada. Though there is also PL/I if you want a language with a loosely Pascalish syntax that relies on the complete opposite design style - the one that was carried over to C and its derivatives.
- trealira 3y agoI doubt that by modern standards, Pascal seems to work if it compiles, compared to languages like Java or Go. They were comparing it to writing spaghetti code with GOTOs everywhere in BASICA, so no wonder their code seemed more reliable. Nowadays, the jump in reliability comes from strong and helpful type systems, not structured programming. Ada still seems good there, but Pascal is just an ordinary programming language.
- CRConrad 3y agoYeah, the benefits of strong typing have nothing to do with Pascal... Sigh. Kids nowadays, etc. Look up which was the original language ridiculed for its "belt-and-braces" approach to type safety, in contrast to C, the freewheeling language of Kewl H4xx0rs (although they weren't yet spelled that way). Now excuse me, there's a cloud I have to go shake my fist at.
- trealira 3y agoI genuinely didn't realize Pascal was recognized as providing having a strong type system. I guess there is Brian Kernighan's "Why Pascal is Not My Favorite Programming Language," where he complains that there's "no escape" to the type system as in C, where anything can be cast to anything. But I took it to mean that C just had an exceptionally loose and liberal type system.
- ben7799 3y agoYah you have to think about this in the context of really bad C code from the 1990s. It was really common for people to stuff pointers in ints and ints in pointers and do all kinds of really abusive things with the memory system in C. It was all fun and games until the program died with nary a stack trace. (Stack traces were pretty amazing the first time I saw them!) There were even big commercial libraries that did really odd stuff. Motif (big early Unix UI framework) did a lot of weird stuff. Pascal was pretty straightforward and disciplined compared to that, although I'm sure developers who were too clever for their own good found ways to do silly things.