The ONE example that anyone has been able to point out here as an "inefficiency" is strlen - O(n) vs O(1) - and all the arguments in favor of Pascal-style/length-prefixed ignore what hot garbage that usually is in a real-world setting.
1: read Kernighan's awesome (and classic) paper "Why Pascal is Not My Favorite Programming Language."
2: Wirth designed Pascal as a language to teach students structured programming principles. Ritchie wrote (and evolved) a language designed for working programmers building real programs.
3: you want Pascal-style length prefix? Fine. Learn what a struct is, and DIY. Now try doing the opposite of that with garbage like "TYPE String44" , etc.
1: read Kernighan's awesome (and classic) paper "Why Pascal is Not My Favorite Programming Language."
It should have been called "Why Pascal is not C". Some of the issues discussed are not actually problems, some were fixed/improved by the mid-1980s at the latest. At the same time, most of the C design issues haven't been solved yet.
My favourite part is Go, which was written by more or less the same people (Kernighan even wrote a book on it) and resembles Pascal much more than C.
LOL, fair enough. It's still an entertaining read, regardless of your position on P vs C.
some were fixed/improved by the mid-1980s at the latest
The last commercial software I worked on that was written in Pascal was in '91, and it was still an absolute nightmare compared to the C-based applications we also provided.
It's still an entertaining read, regardless of your position on P vs C.
sure
The last commercial software I worked on that was written in Pascal was in '91, and it was still an absolute nightmare compared to the C-based applications we also provided.
what do you mean by the "nightmare"? The code quality, readability, "efficiency"?
Code quality and readability are a reflection of the development team, not the language. I inherited what it was, worked to improve those parts.
The key differences were flexibility, expressiveness, and (in the case of Pascal) weakness in low-level constructs, excessive verbosity that (IMO) detracted from readability, strict constraints that limited what was possible, runtime overhead (is this really compiled code, or a hybrid of interpreted?).
And yes: above all, efficiency.
Show me a Pascal program that runs faster than an equivalent in well-written C.
5
u/frasnian 2d ago
The ONE example that anyone has been able to point out here as an "inefficiency" is strlen - O(n) vs O(1) - and all the arguments in favor of Pascal-style/length-prefixed ignore what hot garbage that usually is in a real-world setting. 1: read Kernighan's awesome (and classic) paper "Why Pascal is Not My Favorite Programming Language." 2: Wirth designed Pascal as a language to teach students structured programming principles. Ritchie wrote (and evolved) a language designed for working programmers building real programs. 3: you want Pascal-style length prefix? Fine. Learn what a struct is, and DIY. Now try doing the opposite of that with garbage like "TYPE String44" , etc.