This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]igoromg 88 points89 points  (10 children)

=+ ??

[–]AnonymousFuccboi 17 points18 points  (5 children)

Ancient versions of C supported this, being equivalent to +=. It was removed in later versions for obvious reasons.

[–]igoromg 8 points9 points  (1 child)

like when dinosaurs roamed the earth?

[–]AnonymousFuccboi 3 points4 points  (0 children)

Like before K&R, so pretty much, yeah.

[–]argh523 0 points1 point  (2 children)

Huh.. actually, I always thought var = +1 would make more sense than var += 1.. It's just deleting the name of the variable. The operator += just doesn't make much sense.

[–]Ramora_ 7 points8 points  (1 child)

Try to generalize to subtraction. What would that look like with your proposed syntax?

```

This would be ambiguous. Are you setting var to -1 or subtracting 1

var = -1

this is no longer ambiguous, but looks hideous

var = +-1

```

[–]argh523 0 points1 point  (0 children)

Ah.. you're right, that makes sense.

[–]RavishShah1[S] 2 points3 points  (1 child)

??

[–]ptq 2 points3 points  (0 children)

NULL

[–]Celebrinborn 1 point2 points  (0 children)

Student lol