3 ms·
Only very rarely because modern languages implicitly pass pointers to objects instead of objects themselves. I agree that at a CS 101 level it's a useless compl
by qsort 5y ago
Only very rarely because modern languages implicitly pass pointers to objects instead of objects themselves. I agree that at a CS 101 level it's a useless complication, though.
- mikewarot 5y agoPascal will pass the value of an object by default, you can use a VAR parameter to explicitly allow side effects, or optionally, you could pass the @address of the parameter for things where you want to play with pointers. Wirth was a pretty smart cookie when perfected the lessons from Algol into Pascal. 8)
- qsort 5y agoYeah, I never used Pascal (I cut my teeth on C), but it does seem like a nice language, especially for its time. For something like Java or Python, though, it makes sense that the argument is implicitly a reference to the object it takes (at least as a default). 99% of the times you don't want to pass around stack-allocated stuff.
- iainmerrick 5y agoI started with BASIC, and never liked Pascal at all (I eventually took to C like a duck to water), but it must have something going for it as a systems language because the original Mac OS was largely written in Pascal (I’m not sure of the balance between Pascal and assembly). I wonder if we’d have fewer memory-related bugs now if the industry had standardised on Pascal strings (length prefix) rather than C strings (null-terminated)?