3 ms·
Spark is Ada not Pascal. Pascal strings used to have their actual length in a field at the beginning of the string. Imagine how many off by one errors and how
by nottorp 2y ago
Spark is Ada not Pascal.
Pascal strings used to have their actual length in a field at the beginning of the string. Imagine how many off by one errors and how many (even hidden) calls to strlen() that saves.
All they needed to modernize Pascal is some library code to resize the buffer if needed, just like curly brace languages. It may already be present in modern Pascal implementations, I haven't followed.
Pascal also has array bounds checking by default. Imagine how many out of bounds errors this could prevent.
But no, you have to have curly braces instead and build layers and layers of classes and languages over classes, all over the same impractical string representation.
- pjmlp 2y agoObject Pascal and Delphi dialects have had open arrays for ages. And this was even fixed in ISO Extended Pascal by 1990. Not to mention that Wirth fixed this in Modula-2 in 1978, already, which everyone keeps forgeting it was actually designed for systems programming, while Pascal was originally designed in 1972 for teaching programming concepts. But sure enough, lets complain about ISO Pascal from 1976.