Some Programming Paradigms 1 12212021 Imperative Programming E









- Slides: 9

Some Programming Paradigms 1 12/21/2021

Imperative Programming • E. g. , FORTRAN, C, … • Focus on the algorithms. • Data in separate structures. • Algorithm abstraction: Give name to a sequence of instructions (stepwise refinement). • Structured programming (e. g. , avoid “spaghetti programming” by not using the goto-statement). 2 12/21/2021

“Data Modelling” • Focus on data an the static relationships • Data abstractions: Give name to a group of data (e. g. , named records) 3 12/21/2021

Object-oriented programming • Data and behaviour is put together • E. g. , Smalltalk, C++, Java 4 12/21/2021

The First Object-oriented Language: Simula • Introduced in 1966 (or earlier). • Created by Ole-Johan Dahl and Kristen Nygaard. • A language for simulation but became a general purpose programming language. Allan Key: “Simula is a major improvement of most of its sucessors” 5 12/21/2021

From Wikipedia, the free encyclopedia: Programming paradigms • • Agent-oriented Automata-based Component-based – Flow-based – Pipelined Concatenative Concurrent computing – Relativistic programming Data-driven Declarative (contrast: Imperative) – Constraint – Functional – Dataflow • Cell-oriented (spreadsheets) • Reactive – Logic • Abductive logic • Answer set • Constraint logic • Functional logic • Inductive logic • Uncertain inference – Markov logic – Probabilistic logic Event-driven – Service-oriented – Time-driven • • • Expression-oriented • Feature-oriented Function-level (contrast: Valuelevel) Generic Imperative (contrast: Declarative) – Procedural Language-oriented – Discipline-specific – Domain-specific – Grammar-oriented • Dialecting – Intentional Metaprogramming • – Automatic – Reflective • Attribute-oriented – Template • Policy-based Non-structured (contrast: Structured) – Array (contrast: Scalar) – Iterative Nondeterministic Parallel computing – Process-oriented Programming in the large/small Semantic Structured (contrast: Nonstructured) – Modular (contrast: Monolithic) – Object-oriented • By separation of concerns: – Aspectoriented – Role-oriented – Subjectoriented • Class-based • Prototype-based – Recursive Value-level (contrast: Functionlevel) 6 12/21/2021

All types of modelling involves some “sort of objects” • E. g. , in functional programming you have function and function activations (the call of a function). • It seems that understanding the world as composed of objects is unavoidable… 7 12/21/2021

The Object-oriented Approach Tries To Mimic The Way We Think. • “Accidental complexity is complexity that arises in computer programs or their development process (computer programming) which is non-essential to the problem to be solved. While essential complexity is inherent and unavoidable, accidental complexity is caused by the approach chosen to solve the problem. ” (From Wikipedia, the free encyclopedia) • The oo-approach tries to minimise accidental complexity. 8 12/21/2021

Structure – Behaviour The Yin and Yang of Programming Some UML Structure: : married Jane: Person : owns Jams: Person Jane: Person : owns Some behaviour some. Wreck: Car Underling functional Structure of expression (+ (+ 3 4) 5): + + 3 Graph Reduction 5 4 7 + Graph Reduction 12 5 9 12/21/2021