cs 345: programming language paradigms chris brooks hr 510 mwf 11:00-12:05
TRANSCRIPT
![Page 1: CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f215503460f94c395ec/html5/thumbnails/1.jpg)
CS 345: Programming Language
ParadigmsChris Brooks
HR 510
MWF 11:00-12:05
![Page 2: CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f215503460f94c395ec/html5/thumbnails/2.jpg)
• Introductions
• Course Overview
• Syllabus
• Programming Paradigms– Structured programming– Object-Oriented Programming– Functional Programming– Declarative Programming
![Page 3: CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f215503460f94c395ec/html5/thumbnails/3.jpg)
Structured Programming(Imperative programming)
• Language closely tied to Von Neumann architecture.– Fortran, C, COBOL
• Break code into blocks or subroutines– Modular design – Explicit control of execution– Verb-oriented
• This piece of code takes an action
![Page 4: CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f215503460f94c395ec/html5/thumbnails/4.jpg)
Object-Oriented Programming
• Provide more reuse and speed development– Simula, Smalltalk, C++, Objective C, Java
• Noun-oriented focus– How are system components represented?– What messages does an object understand?– How are objects related to each other?
• Key ideas:– Inheritance, polymorphism, information hiding
![Page 5: CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f215503460f94c395ec/html5/thumbnails/5.jpg)
Functional Programming
• Programs can be recursively composed from smaller programs.– Language is extensible– Programs and data take the same form
• Lazy evaluation
– Lisp, ML, Scheme
• Functions operate on data and return a result without side effects.
• Emphasis on the evaluation of expressions.
![Page 6: CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f215503460f94c395ec/html5/thumbnails/6.jpg)
Declarative Programming• Programs consist of a description of the relevant
data or knowledge relations.– Prolog, SQL, Haskell
• Describe the result to be achieved, rather than how to achieve it.
• A built-in inference engine provides execution control.
• Programs focus on describing the relationship between objects in a domain.
• Programming as proving statements.
![Page 7: CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f215503460f94c395ec/html5/thumbnails/7.jpg)
Different Tasks Require Different Approaches
“If all you have is a hammer, then every problem looks like a nail.”
• Structured programming: focus on actions to take and flow control.– Operating systems, device drivers
• Object-oriented programming: focus on data structures– GUIs, simulations, toolkits
• Functional programming: focus on composition of small computational units.– Compilers, numerical analysis
• Declarative programming: focus on relations among data.– Databases, expert systems.