GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » Scientific Computing » C++ » What would you prefer to use in your code?
What would you prefer to use in your code? [message #1558] Wed, 30 March 2005 18:44 Go to next message
Anar Manafov is currently offline  Anar Manafov
Messages: 81
Registered: August 2004
Location: Germany, Darmstadt
continuous participant

From: kp1pc34.gsi.de

What would you prefer to use in your code?[ 3 votes ]
1. Prefix increment operator 2 / 67%
2. Postfix increment operator 1 / 33%

Subject! Rolling Eyes
Please, comment why you choose one of the methods more often...

Later on I will post the right answer Very Happy


P.S. BTW, this is also testing of a poll Smile




1 horsepower = 745.699872 Watts
Re: What would you prefer to use in your code? [message #1561 is a reply to message #1558] Fri, 01 April 2005 00:46 Go to previous messageGo to next message
Anar Manafov is currently offline  Anar Manafov
Messages: 81
Registered: August 2004
Location: Germany, Darmstadt
continuous participant

From: kp1pc34.gsi.de
Don’t be shy Smile
It is simple question. Please, choose one of the options.

Let’s call it, statistics gathering Smile


1 horsepower = 745.699872 Watts
Re: What would you prefer to use in your code? [message #1681 is a reply to message #1561] Thu, 19 May 2005 18:01 Go to previous messageGo to next message
Dennis Klein is currently offline  Dennis Klein
Messages: 1
Registered: May 2005
Location: GSI, Darmstadt
occasional visitor
From: lxg0513.gsi.de
Hi,
I prefer the prefix version.

To keep my code readable, I use the ++-operator in one line for itself. In this case, there's no difference between the prefix and the postfix version. If you try to implement it by yourself, you will see that the prefix version is much easier, say faster und smaller.
icon14.gif  Re: What would you prefer to use in your code? [message #1682 is a reply to message #1681] Thu, 19 May 2005 19:36 Go to previous message
Anar Manafov is currently offline  Anar Manafov
Messages: 81
Registered: August 2004
Location: Germany, Darmstadt
continuous participant

From: kp1pc34.gsi.de
Exactly! Smile

1 horsepower = 745.699872 Watts
Previous Topic: Al Stevens Interviews Alex Stepanov - STL forever!
Next Topic: Effective C++ 3ed (c) Scott Meyers
Goto Forum:
  


Current Time: Sat Dec 14 08:53:12 CET 2024

Total time taken to generate the page: 0.00616 seconds