Click here to Skip to main content
15,892,697 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Database Code Pin
dasblinkenlight12-Jan-11 11:42
dasblinkenlight12-Jan-11 11:42 
QuestionMatching between product and customer personal information Pin
Yanshof3-Jan-11 20:07
Yanshof3-Jan-11 20:07 
AnswerRe: Matching between product and customer personal information Pin
dasblinkenlight13-Jan-11 6:24
dasblinkenlight13-Jan-11 6:24 
QuestionNeed guidance on designing and preparing MCPD Pin
Praveen Raghuvanshi3-Jan-11 7:11
professionalPraveen Raghuvanshi3-Jan-11 7:11 
AnswerRe: Need guidance on designing and preparing MCPD Pin
Richard MacCutchan4-Jan-11 5:36
mveRichard MacCutchan4-Jan-11 5:36 
GeneralRe: Need guidance on designing and preparing MCPD Pin
Praveen Raghuvanshi4-Jan-11 17:21
professionalPraveen Raghuvanshi4-Jan-11 17:21 
GeneralRe: Need guidance on designing and preparing MCPD Pin
Richard MacCutchan4-Jan-11 21:39
mveRichard MacCutchan4-Jan-11 21:39 
QuestionPossible inefficiency in post-increment FOR loop? Pin
Xpnctoc30-Dec-10 15:12
Xpnctoc30-Dec-10 15:12 
I was reading a coding style document put out by a certain company, when I came across an odd claim in their justification for their FOR loop style. I was wondering if someone could shed some light on this for me:

The document states that a pre-increment operator is preferable to a post-increment operator because post-increment introduces potential inefficiencies when iterating over an object. The example they give is C++ code:

std::vector v;
// vector gets filled here....
for (std::vector::const_iterator i = v.begin(); i != v.end(); ++i)
{
   // iteration code here...
}

...and an identical sample that uses "i++" instead of "++i" for the increment operation.


I see no difference in the efficiency. Whether using ++i or i++, "i" is going to contain its new value before the termination condition is evaluated. The loop will be iterated an identical number of times.

I was wondering if someone could shed some light on what it is that I'm missing here, or if perhaps the assertion that pre-increment is more efficient. Is there some other language or platform that treats identical FOR loop sytax in a wildly different manner?
AnswerRe: Possible inefficiency in post-increment FOR loop? Pin
Richard MacCutchan30-Dec-10 23:05
mveRichard MacCutchan30-Dec-10 23:05 
AnswerRe: Possible inefficiency in post-increment FOR loop? Pin
Luc Pattyn30-Dec-10 23:37
sitebuilderLuc Pattyn30-Dec-10 23:37 
GeneralRe: Possible inefficiency in post-increment FOR loop? Pin
fat_boy31-Dec-10 2:12
fat_boy31-Dec-10 2:12 
AnswerRe: Possible inefficiency in post-increment FOR loop? Pin
fat_boy31-Dec-10 2:13
fat_boy31-Dec-10 2:13 
AnswerRe: Possible inefficiency in post-increment FOR loop? Pin
Peter_in_27804-Jan-11 18:21
professionalPeter_in_27804-Jan-11 18:21 
AnswerRe: Possible inefficiency in post-increment FOR loop? Pin
dasblinkenlight13-Jan-11 2:18
dasblinkenlight13-Jan-11 2:18 
QuestionDiagramming? Pin
dawmail33328-Dec-10 22:48
dawmail33328-Dec-10 22:48 
AnswerRe: Diagramming? Pin
fat_boy31-Dec-10 2:18
fat_boy31-Dec-10 2:18 
QuestionDeveloping to try to make a difference? Pin
Todd Baxter28-Dec-10 3:16
Todd Baxter28-Dec-10 3:16 
AnswerRe: Developing to try to make a difference? Pin
Pete O'Hanlon28-Dec-10 3:27
mvePete O'Hanlon28-Dec-10 3:27 
GeneralRe: Developing to try to make a difference? Pin
Todd Baxter28-Dec-10 5:06
Todd Baxter28-Dec-10 5:06 
GeneralRe: Developing to try to make a difference? Pin
jk chan28-Dec-10 21:49
jk chan28-Dec-10 21:49 
GeneralRe: Developing to try to make a difference? Pin
Todd Baxter29-Dec-10 3:15
Todd Baxter29-Dec-10 3:15 
GeneralRe: Developing to try to make a difference? Pin
jk chan29-Dec-10 4:01
jk chan29-Dec-10 4:01 
AnswerRe: Developing to try to make a difference? [modified] Pin
RobCroll4-Jan-11 3:24
RobCroll4-Jan-11 3:24 
GeneralRe: Developing to try to make a difference? Pin
Todd Baxter4-Jan-11 5:04
Todd Baxter4-Jan-11 5:04 
GeneralRe: Developing to try to make a difference? Pin
RobCroll4-Jan-11 6:21
RobCroll4-Jan-11 6:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.