65 ms·
> Just try to implement the following function in C without using the address-of operator: Pascal had `var` arguments, i.e. call-by-reference, which can be use
by rbehrends 9y ago
> Just try to implement the following function in C without using the address-of operator:
Pascal had `var` arguments, i.e. call-by-reference, which can be used for similar purposes. Call-by-reference isn't a complete replacement for C pointers, of course, but it also avoided the whole host of memory safety issues arising from C's more general model and which plague C to this day.
> But once you've switched to C, the sheer verbosity of Pascal is bothersome. Instead of "{" and "}" Pascal uses "begin" and "end". It uses "procedure" or "function" to introduce a function.
That's entirely subjective, I think. As somebody who grew up with Pascal and learned C later, I found the C syntax to be comparatively hard to read. I do favor the Modula-2/Eiffel/Ada approach of having "end" terminators instead of "begin" / "end" blocks (which share the troubles that braces have), though.