60 likes | 439 Views
Pseudocode. Chapter 13. Designing with Pseudocode. Pseudocode is “fake code” that allows the designer to represent the outline of essential or crucial code segments for the purpose of discussion. Pseudocode stops short of actual implementation. What is Pseudocode?.
E N D
Pseudocode Chapter 13
Designing with Pseudocode • Pseudocode is “fake code” that allows the designer to represent the outline of essential or crucial code segments for the purpose of discussion. • Pseudocode stops short of actual implementation.
What is Pseudocode? • Pseudocode is usually not compilable. • Some “formal” Pseudocode can be considered a “PDL”: Program design language. However many times it is just “made up as we go along.” • Pseudocode can be useful for estimating how much real code needs to be written: some pseudocode can be converted to real code and a ratio established to estimate how many lines of real code might be written.
What is represented by pseudocode? • Major and important control flow: • Decisions (if/then/switch) • Function calls • Major and important data manipulation: • Dereferencing of major structures • Data comparisons and conversions
What shouldn’t be represented by pseudocode? • Mundane manipulations: • Character-by-character operations (finding the end of string, etc.) • Just about anything that can be represented by a “code idiom”: leave something for the programmer to do!