views:

113

answers:

1

What are the most common applications of each control structure. I am trying to get at a reference along the lines of:

Control Structure  - common application

Conditions         - true / false distinction
Selections         - case differentiation of a few known values
Loops              - writing to / reading from lists
 do while          - unknown number of iterations
 for               - known number of iterations
 foreach           - eliminating errors in the loop house keeping arithmetic
Exceptions         - ...
Continuations      - ...
Jumps              - ...
A: 

Check code complete 2 by Steve McConnell. It contains lots of detailed information about all of these, and when to use them.

http://www.amazon.co.uk/Code-Complete-Practical-Handbook-Construction/dp/0735619670

Steve
"eliminating errors in the loop house keeping arithmetic" is a quote form Code Complete. I admit that Steve McConnell inspired me to ask this question. How would the proposed table be improved by Code Complete 2 though? Allowing html-tables on Stackoverflow, a wider site layout, and an exhaustive concordance analysis of imperative source code, would be what I think could make a decent overview out of my proposed juxtaposition
Sebas
somebody downvote this answer please.
Sebas