4 ms·
Standard Pascal did not store string length and had no notion of variable-length strings. This was such an egregious design failure that various dialects came
by drfuchs 3y ago
Standard Pascal did not store string length and had no notion of variable-length strings. This was such an egregious design failure that various dialects came up with non-standard, non-portable, compiler-specific work-arounds. In the 1980's, it was next to impossible to write a Pascal program that worked cross-platform and did anything with strings.
The first ISO standard to address this wasn't until 1990, with yet a new dialect called Extended Pascal, which of course wasn't compatible with the various earlier system-specific dialects, and anyway was way too late for Pascal to "win" over C.
See Wikipedia for confirmation: "Brian Kernighan, who popularized the C language, outlined his most notable criticisms of Pascal as early as 1981 in his article "Why Pascal is Not My Favorite Programming Language". The most serious problem Kernighan described was that array sizes and string lengths were part of the type, so it was not possible to write a function that would accept variable-length arrays or even strings as parameters."
- pjmlp 3y agoHence Modula-2 in 1978, which Brian ignored on this famous rant.
- drfuchs 3y agoModula-2 compilers were slow to appear on many important architectures, and again there were various divergent dialects, and the whole shebang seemed to get semi-abandoned when Wirth et. al. shifted yet again to Oberon; lather, rinse, repeat. So none of his post-Pascal languages posed practical competition to C for writing portable, cross-platform code, either.
- pjmlp 3y agoVMS, UNIX, MS-DOS, Amiga, Archimedes, seemed important enough for me. C only became portable by bringing UNIX alongside via POSIX. Then there were all those dialects, K&R C, Small-C, RatC, DBS C,...