the programming discipline l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
The Programming Discipline PowerPoint Presentation
Download Presentation
The Programming Discipline

Loading in 2 Seconds...

play fullscreen
1 / 11

The Programming Discipline - PowerPoint PPT Presentation


  • 216 Views
  • Uploaded on

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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'The Programming Discipline' - KeelyKia


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
the programming discipline

The Programming Discipline

Things you need to know (learn) for developing

large computer programs.

Professor Stephen K. Kwan

slide2

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.
slide3

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
slide4

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.
structured programming techniques
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”
structured programming techniques6
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.

structured programming techniques7
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!”

structured programming techniques8
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

structured programming techniques9
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

structured programming techniques10
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

issues with structured programming techniques
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