SlideServe
Menu
Préférences
© SlideServe · v2026

Evolution of Structured Programming & Black Magic Coding Violations

cedricc avatar
22 diapositives · 256 Views · Nov 04, 2019

Learn about the transition from chaotic "Spaghetti Code" to organized Structured Programming in languages like Pascal and C++. Explore how structured coding principles revolutionized coding practices and the battle against violations like GOTO statements. Discover why certain coding constructs were banned in early programming languages due to their detrimental impact on program flow and debugging. Join the journey of programming evolution and the importance of maintaining structured code.

Evolution of Structured Programming & Black Magic Coding Violations - slide 1
1 / 22

Télécharger la présentation

Evolution of Structured Programming & Black Magic Coding Violations
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Black Magic Coding Constructs considered Violations of Structured Programming

  2. Background Programming Languages before the 1980’s allowed program flow to “bounce around” anywhere the programmer wanted.

  3. Background RESULT: “Spaghetti Code”

  4. Background “Spaghetti Code” very difficult to Debug almost impossible to Maintain not Reusable

  5. Background Solution: Structured Programming Organize and encapsulate code into clear, maintainable segments, each with one Entry and Exit point.

  6. Background Structured Programming: Example 1

  7. Background Structured Programming: Example 2

  8. Background Many battles were fought in the 1960’s-80’s

  9. Background Structured Programming Won. A major result: the standard use of the Pascal language to teach new programmers. Pascal enforces concepts of Structured Prog.

  10. C++ There are statements in C (and so C++) that violate Structured Programming to some degree

  11. C++ return from anywhere in a function: Actually a major violation of SS, but commonly used by C++ programmers.

  12. C++ return from anywhere in a function: int main() { ... if (something) return 1; ... return 0; }

  13. C++ continue jump to the end of a loop somewhat common in C++

  14. C++ continue while (something) { //loop control ... if (something) // jump to beginning of loop continue; ... }

  15. C++ break exit a control block (loop, switch, if, etc.) a little more common in C++

  16. C++ break; while (something) { //loop control ... if (something) break; // exit the loop ... } // jump to here

  17. C++ “The word that SHALL NOT be uttered” banned by most C++ programmers unrestricted use in C major restrictions in C++

  18. C++ The word that SHALL NOT be uttered: GOTO

  19. CS 215 The following should NOT be used in any CS 215 programs (labs, projects, tests) continue break (except in a switch) goto

  20. CS 215 The following is allowed: return in the middle of a function

  21. After 215 Once you’ve finished CS 215 and “Earned Your Stripes” you may be allowed to use these statements, but... Best to ask the Instructor

  22. Test Nothing from this set of slides will be on the tests... except NOT using the “banned” statements.