3 ms·
'My CS teacher also resolved many difficulties with the = sign by always reading code like "a = b" as "a gets b"' This is one of the great things about Pascal.
by dodedo 15y ago
'My CS teacher also resolved many difficulties with the = sign by always reading code like "a = b" as "a gets b"'
This is one of the great things about Pascal. The := sign is used for assignment, and the equals sign alone is used for equality. It's very natural to call := 'gets' and keep a clear distinction between assertions and assignments.
- Jach 15y agoI totally agree, := should be used more. (More than once I've had (define := define) in my personal Scheme code.) Unfortunately my enthusiasm in the past has been met with the quip "Any language that uses := as the assignment operator inevitably dooms itself to never becoming more popular than Pascal." Not many people care anymore. (They did at one point; a lot of 80s and some 90s C code is so macro'd up it looks a lot like a dialect of BASIC.)