0
0

[–] RicardoBronson ago  (edited ago)

They both suck because of unspecified behavior in some situations. And usually when you want it least. Like for loops using pointers. Trust me, just say "counter += 1" and you will never have to know the pain EDIT: Actually why bother trusting me, do a search: https://www.google.com/search?hl=en&q=postfix%20increment%20unspecified%20behavior

1
-1

[–] WhiteMakesRight 1 point -1 points (+0|-1) ago  (edited ago)

The operators have nothing to do with the unspecified behaviour you're talking about though -- they're just a succinct way to trigger it. What's actually unspecified is the order of evaluation of function arguments -- which is something you should be aware of even if you never use increment operators.

Not using increment operators at all is a typical example of "scarring on the first cut". If you're going to write software in C, rules-of-thumb will only get you so far. At some point, you have to read and understand the specification in depth.

0
0

[–] RicardoBronson ago 

I take more of a "when in doubt, do it in python" approach because life is just too short to spend on specifications :) But I'm sure you're right

0
0

[–] WhiteMakesRight ago 

Who cares. CoffeeScript took "nice" syntax to it's logical conclusions and ended up with the ugliest and most unreadable language ever created.

0
0

[–] BitterBiped ago  (edited ago)

The post ++ is better than the pre ++. Because if it weren't Stroustrup would have called it ++C and not C++, kappa.