1.2.4 - Types of Programming Language Flashcards
What are programming paradigms?
Different approaches to using a programming language to solve a problem.
What are imperative programming paradigms?
These are paradigms which clearly specify the action to be performed.
What is procedural programming?
This is a type of imperative programming which uses a sequence of instructions which may be contained within procedures.
These instructions are carried out in a step-by-step manner.
Why is procedural programming good?
- Applied to a wide range of problems
- Easy to write and interpret
What is OOP?
OOP is built on entities called objects formed from classes which have certain attributes and methods. OOP focuses on making programs that are reusable and easy to update and maintain.
Why is OOP good? (structure)
OOP is applicable to certain types of problem with lots of reusable components which have similar
characteristics. This is because of inheritance and polymorphism.
It also has a modular structure, meaning classes can be easily maintained and updated.
What is declarative programming?
Declarative programming focuses on stating the desired result rather than the exact series of instructions that need to be performed to get to the result.
It is the role of the programming language to determine how best to obtain the
result and the details about how it is obtained are
abstracted from the user.
When is declarative programming used?
It is common in expert systems and artificial intelligence.
What is functional programming?
Functional programming uses the concept of reusing a set of functions, which form the core of the program. Programs are made up of lines of code consisting of function calls, often combined within each other. Functional programming is closely linked to mathematics.
What is logic programming?
Logic languages are also part of the declarative programming paradigm and use code
which defines a set of facts and rules based on the problem.
Queries are used to find
answers to problems.
What is structured programming?
Structured programming is a popular subsection of procedural programming in which the
control flow is given by four main programming structures: sequence, selection, iteration and recursion.
Procedural programming is suited to problems that can easily be expressed as a series of instructions using the above constructs.
What does sequence mean?
Code is executed line-by-line, from top to bottom.
What does selection mean?
A certain block of code is run if a specific condition is met, using IF statements.
What does iteration mean?
A block of code is executed a certain number of times or while a condition is met. Iteration uses FOR, WHILE or REPEAT UNTIL loops.
What does recursion mean?
Functions are expressed in terms of themselves. Functions are executed, calling themselves, until a certain condition known as a base case (which does not call the function) is met.