Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Programming Discipline Professor Stephen K. Kwan Things you need to know (learn) for developing large computer programs.

Similar presentations


Presentation on theme: "The Programming Discipline Professor Stephen K. Kwan Things you need to know (learn) for developing large computer programs."— Presentation transcript:

1 The Programming Discipline Professor Stephen K. Kwan Things you need to know (learn) for developing large computer programs.

2 1.The Programming Project – problem statement, purpose & scope 2.The Problem Solution Approach – algorithms 3.Diagrammatic Aids 4.The Operating Environment 5.Choosing the Programming Language – grammar (syntax and semantics), Text/GUI, purpose 6.The Primitives of the Language – objects, variables, data types, declarations, numbers, strings, etc.

3 8.The Input/Output (I/O) System 9.Arithmetic Expressions and Assignment Statements 10.Decision Making and Logical Expressions 11.Support of Structured Programming Techniques 12.Functions and Subroutines - modules 13.Event-based Programming for GUIs, Interface Design 14. Internal Storage - Arrays and Data Structures 15. External Storage - Files and Databases

4 16. Error Detection and Handling 17. Input Validation 18.Output Formatting 19. Debugging and various levels of testing 20. Projects and Programming Tasks 21. Operational issues – compile/link/execute 22. Deployment, Version Control, etc.

5 Structured Programming Techniques Motivation: We need help in dealing with large programs The Halting Problem for Programs, that is, The Halting Problem for Programs, that is, the problem as to whether a given program with given input ever halts, is recursively undecidable (proof). proof Must avoid “spaghetti code” Must avoid “spaghetti code” More

6 Structured Programming Techniques Step-wise refinement to “ organize the computation in such a way that our limited powers are sufficient to guarantee that the computation will establish the desired effect.” Edsgar W. Dijkstra, “Notes on Structured Programming”, in Dahl, Dijkstra and Hoare, Structured Programming, Academic Press, 1972.

7 Structured Programming Techniques “If the chance of correctness of an individual component equals p, the chance of correctness of a whole program, composed on N such components, is something like P = p N As N will be very large, p should be very, very close to 1 if we desire P to differ significantly from zero!”

8 Structured Programming Techniques Adopt the following techniques: Block 1Block 2Block 3 Sequence Each Block has one Entrance and one Exit “GO-TO-less”

9 Structured Programming Techniques Block 1 Block 2 Repetition Relation While Relation Is True Do Block 1 Do Block 2 Until Relation Is True T F T F Each Block has one Entrance and one Exit

10 Structured Programming Techniques Block 1Block N Selection RelationVariable IF-THEN-ELSE CASE OF TF Each Block has one Entrance and one Exit Block 2 Block 1 :::: = 1= 2= N

11 Issues with Structured Programming Techniques Regardless of whether the programming language represents data as objects or not, we should employ Structured Programming Techniques in constructing procedural code. System Designs often undergo a lot of changes System Designs often undergo a lot of changes Event-based programming for GUI usually involve small modules of code in response to user- initiated events Event-based programming for GUI usually involve small modules of code in response to user- initiated events Structured Programming Techniques only deals with procedural code, does not deal with data that are acted upon by the program – this is addressed by object-oriented programming languages Structured Programming Techniques only deals with procedural code, does not deal with data that are acted upon by the program – this is addressed by object-oriented programming languages End


Download ppt "The Programming Discipline Professor Stephen K. Kwan Things you need to know (learn) for developing large computer programs."

Similar presentations


Ads by Google