View Single Post
Old Jul 1st, 2005, 5:51 PM   #7
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
There is a remote chance that a post-increment of a complex object will take a clock cycle or two more than a pre-increment of the same object. For the hugely vast majority of such operations applied to simple or atomic types the code emitted by the compiler will be the same. One would always be safe, I suppose, with the pre-increment. I, however, despise self-anointed high-priest/gurus (let me be clear -- Ancient Dragon is NOT one) that have an endless bag of dictums with which to bury neophytes and enhance their power (e.g., "I said so, that's why"). In the hopes that I may cause one of these types to spit a frothy, bloody, bubble of rage on his/her homemade vestments, I almost always use the post-increment operator.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote