General Programming Flashcards
Name 5 programming paradigms
Imperative, Procedural, Functional, Declarative, Object-oriented
What paradigm consists of sets of detailed instructions given to the computer to execute in a given order?
Imperative Programming
What is Imperative Programming?
A paradigm which consists of sets of detailed instructions to be executed in a given order
What derivation of Imperative Programming adds functions to the mix?
Procedural Programming
What do “procedures” or “subroutines” consist of in Procedural Programming?
Functions
What programming paradigm treats functions as first-class citizens, meaning they can be assigned to variables, passed as arguments and returned from other functions?
Functional Programming
What do you call a function that always produces the same result given the same input?
Pure Function
What paradigm encourages to mostly write in functions?
Functional Programming
What paradigm encourages code modularity and the absence of side effects?
Functional Programming
What paradigm would advocate minimising global scope variables?
Functional Programming
What paradigm aims to hide away from complexity and be immediately human-readable?
Declarative Programming
What is Declarative Programming?
A paradigm that promotes human-readability and emphasises the result required, rather than the instructions.
If Declarative Programming focuses on the “end”, what paradigm focuses on the “means”?
Imperative Programming
What is Functional Programming?
A paradigm featuring pure functions, recursion and first-class functions
What is Procedural Programming?
A type of Imperative Programming also known as top-down problem-solving
What is OOP?
A paradigm which separates concerns which are coded as objects
What style of programming features entities that all have their own properties and methods?
OOP
What paradigm makes heavy use of classes?
OOP
What is an instance in OOP?
An Object created from a Class
What do you call an Object created from a Class in OOP?
Instance
What 1994 book explores the capabilities and pitfalls of OOP?
Design Patterns
What Creational Design Pattern ensures that a class has only one immutable instance?
Singleton Pattern
What is a Singleton?
A design pattern than ensures a class has only one immutable instance
What Pattern consists of an object that can’t be copied or modified?
Singleton Pattern