Reply to post: Re: Re introducing ":="

Python creator Guido van Rossum sys.exit()s as language overlord

FeRDNYC

Re: Re introducing ":="

Two-digit years wasn't so much about typing as it was about data storage, back in a time when saving two bytes per date seemed like real economy. If it was just about typing, they could've allowed operators to type a two-digit year, but stored it as 19xx, in which case Y2K would've been a snooze. (The same way UNIX has always stored dates as integers — seconds since the epoch — for efficiency, and therefore UNIX/Linux were largely immune to the Y2K bug, at least in terms of system code.)

Pascal did indeed use ':=' for assignment (and '=' for equality test), whereas C went with '=' and '=='. Which probably was about typing laziness regarding the shifted character.

(Or possibly internationalization — did the ':' character appear on all early keyboard layouts? Does it appear on all of them now, for that matter? Obviously it's already required if you want to write Python code, so it's not an issue using it for ':='.)

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019