Programming paradigms Flashcards

1
Q

What is a programming language

A

A formally defined language comprising a set of instructions intended to control the operation of a computer

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

What is a programming paradigm

A

A way to classify programming languages based on their features. Most languages can be classified into multiple paradigms.

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

What is functional programming

A

A way of writing software applications using only pure functions and immutable values.

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

Key features of low level languages

A

Opcodes (Mnemonics), Operands, Registers, Memory Modes

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

What are low level languages good for

A

Device drivers, OS development
(particularly embedded systems),
ultra high performance code

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

What are low level languages bad for

A

Portability, abstraction, rapid development

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

Key features of procedural languages

A

Sequence, Selection (a.k.a. Branching), Iteration, Recursion

Linear execution of instructions.

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

What are procedural languages good for

A

Writing code with lots of algorithms.
Anything where you want fine control
and high performance but want more
portability than assembly language.

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

What are procedural languages bad for

A

Brevity (other paradigms provide more concise alternatives).

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

key features of OOP

A

Encapsulation, Instantiation, Inheritance, Polymorphism

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

What is OOP good for

A

Abstraction when dealing with real
world objects. Modularity.

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

Key features of functional languages

A

First Class, Higher Order and Pure Functions. Immutability and reusing these functions

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

What is OOP bad for

A

Efficient code for limited resource
environments, transparent (easy to
trace) code, concurrent programming

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

What are functional languages good for

A

Robust, predictable and reliable code.
Efficient and highly optimisable code.
Concurrency safe processing

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

What are functional languages bad for

A

Beginners as hard to learn and program in

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

Key features of declaritive languages

A

Queries, C.R.U.D., Facts and Rules, Relationships

17
Q

What are declarative languages good for

A

Databases, Expert systems, Artificial Intelligence

18
Q

What are declaritive languages bad for

A

Control over what the computer is actually doing

19
Q

Which are imperitive

A

Procedural and oop

20
Q

WhIch are declaritive

A

functional and logic

21
Q

What are imperitive languages

A

Use code that clearly specifies the actions to be performed

22
Q

What does oop focus on

A

Easy to re use and update and maintain

23
Q

What does declaritive focus on

A

Stating the desired result rather than instructions to get that result which is why it is used for AI

24
Q

example of functional languages

A

java and c#

25
Procedural langauges positive
Easy to implement
26
Procedural languages negative
brevity and not suitable for all solutions
27
What are procedural languages
Procedural languages use traditional data types such as integers and strings which are built into the language and also provide data structures like dictionaries and arrays.
28
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:
29
Advantages of OOP classes
- Classes can also be used across multiple projects. www.pmt.education
30
Advantages of oop reusability
- OOP allows for a high level of reusability, which makes it useful for projects where there are multiple components with similar properties. The properties of inheritance and polymorphism within OOP allow for this.
31
Advantages of OOP planning
- OOP requires advance planning to determine how the problem will be broken down into classes and how these will link to each other. A thorough design can produce a higher-quality piece of software with fewer vulnerabilities.
32
Advantages of OOP abstraction
There is a high level of abstraction and it is not necessary for programmers to know details about how code is implemented. Once classes have been created and tested, they can be reused as a black box which saves time and effort.
33
Advantages of OOP encapsulation
- Encapsulation is a key reason for choosing OOP as it makes the code more reliable by protecting attributes from being directly accessed. Code for different classes can also be produced independently of others.
34
Why is OOP easy to update and maintain
Because of its modularity
35
Disadvantages of OOP
This is a different style of programming and so requires an alternative style of thinking. This can be difficult for programmers accustomed to other paradigms to pick up. - OOP is not suited to all types of problems. Where few components are reused,. - Generally unsuitable for smaller problems
36
Procedural
uses sequence of instructions that an be contained in procedure
37
Advantages of oop inheritence
inheritance can be used to extend upon existing classes
38
Advantages of oop debugging
Can be easier as encapsulation limits how attributes are changed
39
OOp teamwork
Better for coding as a part of a team as classes can be distributed between teams