The pie chart is probably severely lopsided.
EDIT: Since the main problem is the precedence of the post increment/decrement operator, I would have preferred to see them get rid of that one and keep ++foo but overall not much of a loss.
At least they didn't get rid of the ternary operator like Go did...
I'm also willing to accept that I'm old, stubborn, and unhappy about changing my ways and that this is the future... :)
I can't even think of a time where I really needed a use-then-increment operator where I wouldn't have just used the value, then incremented it on the next line anyway (maybe even with a post-increment out of habit).
I use ++x very infrequently, and mainly in hand-written text parsers.
int arr[5];
int i = 0;
while (shouldIKeepGoing() && i < 5) arr[i++] = getAThing();
If you use ++i there you'll skip 0 and overflow the array. This is what the postfix form is for, if you value terseness.Edit: To clarify, I'm not necessarily saying you don't know that's what it's for, but this is a pattern I see pretty frequently in the wild so I'm just throwing it out there with an explanation of why people find value in it.
int x = 0;
printf("%d %d", x++, x++);
print? Is that true for all systems and compilers? (Answer: nope!). foo(a++, a++);
What values get passed foo()? In some languages, it's undefined (!). In others, there is a well-defined answer, but even there the answer may not be intuitive. Removing assignment expression forms avoids this. Note that even "=" is a statement in Go.It does sacrifice a little expressiveness. But in languages that have dedicated syntax like ranges for iterating over sequential numbers, the ++ and -- operators end up pretty rarely used so it's no big loss.
In Python and Rust as well.
This is one of the big points too, that often gets overlooked. The removal of ++ fits nicely with the removal of C-style for loops.
C:
int foo = bar ? 2 : 4;
Go: foo := map[bool]int{true:2, false:4}[bar]
Python had a similar trick before 2.5 added ternary conditionals.postfix operator ++{}
postfix func ++(lhs:Int) -> Int { return lhs + 1 }
Perhaps this demonstrates perfectly why it's being removed!
It also helped you write smellier code, with the exception of using it in for..loops' 'signature definition'.
For...loops in swift and generally elsewhere are being superseded by for...each loops like python's(and other languages)