Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an...
Transcript of Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an...
![Page 1: Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an American accent.](https://reader036.fdocuments.us/reader036/viewer/2022082505/56649da05503460f94a8baa2/html5/thumbnails/1.jpg)
Unusual Control Structures and General Control Issues
A Presentation by CJ Castellani as told in an
American accent
![Page 2: Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an American accent.](https://reader036.fdocuments.us/reader036/viewer/2022082505/56649da05503460f94a8baa2/html5/thumbnails/2.jpg)
Returns
• Multiple returns can enhance a routine’s readability and maintainability, and they help prevent deeply nested logic.
• They should still be used carefully
![Page 3: Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an American accent.](https://reader036.fdocuments.us/reader036/viewer/2022082505/56649da05503460f94a8baa2/html5/thumbnails/3.jpg)
Recursion
• Recursion provides elegant solutions to a small set of problems
• Also use carefully
![Page 4: Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an American accent.](https://reader036.fdocuments.us/reader036/viewer/2022082505/56649da05503460f94a8baa2/html5/thumbnails/4.jpg)
GOTOs
• In a few cases gotos are the best way to write code that is understandable and maintainable
• But that is rare• They should be used as a last
resort
![Page 5: Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an American accent.](https://reader036.fdocuments.us/reader036/viewer/2022082505/56649da05503460f94a8baa2/html5/thumbnails/5.jpg)
Boolean Expressions
• Simple and readable boolean expressions
• Improves quality of code
![Page 6: Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an American accent.](https://reader036.fdocuments.us/reader036/viewer/2022082505/56649da05503460f94a8baa2/html5/thumbnails/6.jpg)
Nesting
• Deep nesting can make things overly complicated
• It is easily avoidable
![Page 7: Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an American accent.](https://reader036.fdocuments.us/reader036/viewer/2022082505/56649da05503460f94a8baa2/html5/thumbnails/7.jpg)
Structure
• Simplifying your programming is still relevant
• Any program can be built with a combination of good structured sequences and iterations
![Page 8: Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an American accent.](https://reader036.fdocuments.us/reader036/viewer/2022082505/56649da05503460f94a8baa2/html5/thumbnails/8.jpg)
Complexity
• Minimize it to write high quality code
![Page 9: Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an American accent.](https://reader036.fdocuments.us/reader036/viewer/2022082505/56649da05503460f94a8baa2/html5/thumbnails/9.jpg)
More Humor