1 / 11

The Programming Discipline

The Programming Discipline Things you need to know (learn) for developing large computer programs. Professor Stephen K. Kwan The Programming Project – problem statement, purpose & scope The Problem Solution Approach – algorithms Diagrammatic Aids The Operating Environment

KeelyKia
Download Presentation

The Programming Discipline

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

  4. Error Detection and Handling • Input Validation • Output Formatting • Debugging and various levels of testing • Projects and Programming Tasks • Operational issues – compile/link/execute • Deployment, Version Control, etc.

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

  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 = pN 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: Sequence Block 1 Block 2 Block 3 “GO-TO-less” Each Block has one Entrance and one Exit

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

  10. Structured Programming Techniques Selection IF-THEN-ELSE CASE OF T Relation F Variable = 1 = 2 = N Block 1 Block 2 Block 1 Block 2 Block N :::: Each Block has one Entrance and one Exit

  11. Issues with Structured Programming Techniques • 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 • 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 Regardless of whether the programming language represents data as objects or not, we should employ Structured Programming Techniques in constructing procedural code. End

More Related