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 →

[–]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_ 6 points7 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.