Programming paradigms Flashcards
What generation are high-level languages?
Third
What generation are low-level languages?
First (machine code) or Second(assembly language)
Define paradigm
A style or way of thinking about how to solve a problem
How do HLL make it easier for people to understand code?
They abstract many of the steps the computer needs to solve a problem in a program
What are imperative languages designed to do?
Solve specific problem types
How do programmers use imperative languages to solve a problem?
By writing a set of instructions to say how the problem should be solved, the instructions are translated from HLL to object code
What’s an advantage of an HLL?
They have built-in functions and libraries
What type of language are functional languages?
A type of declarative language
How do declarative languages work?
They have no mutable data structures, instead, they use things like mathematical expressions where the same input = the same output.
Functions can call other functions and use the output of one function as input for another.
Their immutable data structures make them ideal for processing big data
How do programmers use object orientated code?
They use classes to define objects in order to model the problem
What are the 4 main principles of OOP?
Encapsulation, abstraction, inheritance, and polymorphism
What is encapsulation?
The state of an object is private and other objects can only interact with the object’s public methods
What is abstraction?
The complexities of how the object works are hidden
What is inheritance?
When subclasses inherit properties and methods from parent classes
What is polymorphism?
The ability of an object to take on many different forms