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
Key features of declaritive languages
Queries, C.R.U.D., Facts and Rules, Relationships
What are declarative languages good for
Databases, Expert systems, Artificial Intelligence
What are declaritive languages bad for
Control over what the computer is actually doing
Which are imperitive
Procedural and oop
WhIch are declaritive
functional and logic
What are imperitive languages
Use code that clearly specifies the actions to be performed
What does oop focus on
Easy to re use and update and maintain
What does declaritive focus on
Stating the desired result rather than instructions to get that result which is why it is used for AI
example of functional languages
java and c#