4 ms·
x = x + 1 I remember the fist time I saw that line and said, that's false. And it's been an ever ending divergence from pure math for the past 30 years.
by 0x445442 9y ago
x = x + 1
I remember the fist time I saw that line and said, that's false. And it's been an ever ending divergence from pure math for the past 30 years.
- goatlover 9y agoIt can also be: x <- x + 1 x := x + 1 But I guess since assignment is more frequent than equality checks, most PL designers opt for using equals. I do like R's left arrow assignment operator. If only keyboards had a default arrow character key. It would completely get rid of a class of errors based on forgetting the second equals sign.
- user5994461 9y agoA sane compiler always give a warning when doing a comparison outside a condition and when doing an assignment within a condition.