I'm looking at a programming language design decision that's difficult to make precisely because there seems to be no objective basis for choosing one option over the other. The question is, given that a language doesn't have a
++ operator, would the better choice for an increment operator be as in C:
a += 1 a += b
or as in some versions of Pascal:
inc a inc a b
(And similarly with
dec of course.)
Considerations I can see for
- Slightly shorter for the typical case where the delta is 1.
- Less familiar to most programmers.
- Eliminates the corresponding
*=etc operators, which are much less commonly used.
Is there anything I'm missing?