Comments by "Lawrence D’Oliveiro" (@lawrencedoliveiro9104) on "ALGOL 68 Instead of Pascal? - Computerphile" video.
-
35
-
A couple of significant notational differences between C and Pascal are, when declaring variables, C inherits the Algol syntax of type-spec before variable name: “«type-spec» «var-name»” whereas Pascal invented its own syntax: “«var-name» : «type-spec»”. And also pointer dereferencing: C uses a prefix operator “*«pointer-val»” whereas Pascal has a postfix one: “«pointer-val»^”.
This may seem very tomayto-tomahto, but consider how C++, which inherits C syntax lock stock and barrel, is now trying to deal with newer features involving dependencies between types, for example between the arguments to a function and its result type. It now finds that, in addition to the C syntax of putting the return type before the function name, it also has to add an alternative syntax where the return type comes after the argument list, à la Pascal.
As for the pointer issue, this may not occur very often, but back in my Mac programming days, more than once I had to write an expression like “thePort^^.theGDevice^^.gdPMap^^.pmTable”,
which in C would have had to become “(**(**(**thePort).theGDevice).gdPMap).pmTable”. (These were structures defined for interfacing to the Mac system, not created by me.) Which would you prefer?
27
-
10
-
8
-
3
-
3
-
3
-
2
-
2
-
1
-
1
-
1