3 ms·
BCPL vectors seem to be the same as C arrays, no? dmr wrote at http://cm.bell-labs.com/cm/cs/who/dmr/bcpl.html http://cm.bell-labs.com/cm/cs/who/dmr/bcpl.html
by kps 14y ago
BCPL vectors seem to be the same as C arrays, no?
dmr wrote at http://cm.bell-labs.com/cm/cs/who/dmr/bcpl.html http://cm.bell-labs.com/cm/cs/who/dmr/bcpl.html that “C was invented in part to provide a plausible way of dealing with characters when one begins with a word-oriented language. [...] BCPL later found a solution better, on its own terms, by providing an operator (%) analogous to its !, such that v%i designates the i-th character in a vector. However, the earliest BCPL applications tended not to process packed characters in vectors, but to spread them out early into one character per word, process, and then pack them again if necessary.”
- pjmlp 14y agoI meant about the design decision to ignore what other system programming languages were already offering on those days. Algol and PL/I already offered what I consider proper arrays and string types. The performance argument about bounds checking is stupid, because any proper compiler offered the possibility to disable bounds checking for code regions. Sadly the decision taken was another one with the security consequences everyone was to endure with software written in C. At least C++ offers a way out for the developers that embrace STL and similar libraries.