News for hackers. Stuff that matters.
Re:Ruby adds experimental support for Rightward assignments by dragonwriter on Friday September 04, 2020 @03:29PM (#24378129)
> On an unrelated side note, I've always thought "=" was a huge mistake in language design, confusing countless people who are coming into programming who reasonably mistake it for equality. I don't know why it won over ALGOL-style ":=".

Probably because adding a colon to an equality sign doesn’t clarify the meaning at all.

Had Algol (as some less widely influential for other reasons languages have) adopted something that more clearly represented movement into the variable being assigned like:

  a <- 25
Maybe it would have won out over “=" for assignment.
Re:Ruby adds experimental support for Rightward assignments by lioeters on Friday September 04, 2020 @03:59PM (#24378377)
I considered such an assignment operator for a little language I was developing, but there was an ambiguity between this:

  a <- 25
and this:

  a < -25
Since everything was an expression in the language, the latter would evaluate to a boolean. In the end I just went with "=" for assignment, and "==" for equality.