Paradigms - Programming Paradigms Procedural Functional...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Paradigms Procedural Functional Logic Object-Oriented
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Specifying the WHAT Describe the Inputs Specific values Properties Describe the Outputs (as above) Describe the Relationships Between I x O As a possibly infinite table Equations and other predicates between input and output expressions For a given input, output may not be unique
Background image of page 2
Specifying the HOW Describe the Inputs Specific values Properties Describe HOW the Outputs are produced Models of existing computers Program State Control Flow A Few Abstractions Block Structure Recursion via a Stack
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Procedural programming Describes the details of HOW the results are to be obtained, in terms of the underlying machine model. Describes computation in terms of Statements that change a program state Explicit control flow Synonyms Imperative programming Operational Fortran, C, … Abstractions of typical machines Control Flow Encapsulation Control Structures Procedures No return values Functions Return one or more values Recursion via stack
Background image of page 4
Procedural Programming: State Program State Collection of Variables and their values Contents of variables change Expressions Not expected to change Program State Assignment Statements Other Statements Side Effects
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
C, C++, C#, Java Abstractions of typical machines Control Flow Encapsulation Control Structures Procedures No return values Functions Return one or more values Recursion via stack Better Data Type support
Background image of page 6
Illustrative Example Expression (to be computed) : a + b + c Recipe for Computation Account for machine limitations Intermediate Location T := a + b; T := T + c; Accumulator Machine Load a; Add b; Add c Stack Machine Push a; Push b; Add; Push c; Add
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Declarative Programming Specifies
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 30

Paradigms - Programming Paradigms Procedural Functional...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online