1.2.4 Programming Paradigms Flashcards

1
Q

What are programming paradigms?

A

A programming paradigm is the approach that a programming language takes to solve problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the main types of programming paradigms?

A
Low Level Languages
Object Oriented languages
Declarative languages
Procedural languages
Functional languages
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are Low level languages?

A

Low level languages are very close to machine code, and tied to specific CPU families.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are some advantages of using Low level languages?

A

They are well suited for close control of the CPU

They are very efficient - well optimised code written in LLL can be made to run very quickly compared to other paradigms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are some disadvantages of using Low level languages?

A

They can be difficult to use as programming commands are quite obscure
You need to know a lot of detail about the internal structure of the CPU to program in assembly language
Low level languages produce the least portable source code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are Procedural languages?

A

Procedural languages are one of the most common programming paradigms. Sets of instructions are grouped into subroutines and functions and they are imperative and sequential

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some advantages of using Procedural languages?

A

Excellent for general purpose programming
Has been well explored and many books and references are avaliable on it
Good level of control is given to the programmer without having to know precise CPU details
Portable source code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are some disadvantages of using Procedural languages?

A

There are many procedural languages - a programmer tends to have to specialise in one specific language
The programmer needs to be precise and knowledgeable about programming instructions - fully debugged programs take time to create
Not as efficient as low level languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are Object Oriented Languages?

A

Object Oriented Programming languages use templates, called classes to define items that they are working with. Classes are templates that have a set of attributes, and objects within a class share the same set of attributes, with the possibility of different values for these.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are some advantages of using Object Oriented Languages?

A

It is easy to reuse classes for different programs and there are libraries of classes already written by people.
Organising data into classes containing methods makes it less likely to unintentionally overwrite data values
Classes are modular and can be tested without affecting the rest of the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are some disadvantages of using Object Oriented Languages?

A

Complicated and difficult to learn

Code is less compact and efficient compared to Low Level languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are declarative languages?

A

Declarative languages are not imperative. The programmer specifies what needs to be done, not how to do it. The software seeks a goal by interrogating a database containing Facts and Rules.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are some features of Declarative Languages?

A

It is NOT sequential, it does not matter what order the Facts and Rules are arranged in
Mostly used in fields such as artificial intelligence and expert systems
Works well when data is inexact and decisions are general
Declarative languages have the ability to backtrack, to have a search go back and forward while checking criteria.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are Functional Languages?

A

Functional languages specialise in answering problems purely through applying calculations to input. They do not change anything else other than the data provided. The calculations they apply are called functions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are some features of Functional Languages?

A

They do not change anything other than the data provided
Do not have side effects unlike procedural languages
Used extensively in highly mathematical areas such as engineering and finance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly