control structures - common applications
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 - cas开发者_JS百科e 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 - ...
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
精彩评论