Programming paradigms Flashcards
What is a programming language
A formally defined language comprising a set of instructions intended to control the operation of a computer
What is a programming paradigm
A way to classify programming languages based on their features. Most languages can be classified into multiple paradigms.
What is functional programming
A way of writing software applications using only pure functions and immutable values.
Key features of low level languages
Opcodes (Mnemonics), Operands, Registers, Memory Modes
What are low level languages good for
Device drivers, OS development
(particularly embedded systems),
ultra high performance code
What are low level languages bad for
Portability, abstraction, rapid development
Key features of procedural languages
Sequence, Selection (a.k.a. Branching), Iteration, Recursion
Linear execution of instructions.
What are procedural languages good for
Writing code with lots of algorithms.
Anything where you want fine control
and high performance but want more
portability than assembly language.
What are procedural languages bad for
Brevity (other paradigms provide more concise alternatives).
key features of OOP
Encapsulation, Instantiation, Inheritance, Polymorphism
What is OOP good for
Abstraction when dealing with real
world objects. Modularity.
Key features of functional languages
First Class, Higher Order and Pure Functions. Immutability and reusing these functions
What is OOP bad for
Efficient code for limited resource
environments, transparent (easy to
trace) code, concurrent programming
What are functional languages good for
Robust, predictable and reliable code.
Efficient and highly optimisable code.
Concurrency safe processing
What are functional languages bad for
Beginners as hard to learn and program in