Programming paradigms Flashcards

You may prefer our related Brainscape-certified 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
Q

Procedural langauges positive

A

Easy to implement

26
Q

Procedural languages negative

A

brevity and not suitable for all solutions

27
Q

What are procedural languages

A

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
Q

What is structured programming

A

Structured programming is a popular subsection of procedural programming in which the
control flow is given by four main programming structures:

29
Q

Advantages of OOP classes

A
  • Classes can also be used across multiple projects.
    www.pmt.education
30
Q

Advantages of oop reusability

A
  • 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
Q

Advantages of OOP planning

A
  • 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
Q

Advantages of OOP abstraction

A

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
Q

Advantages of OOP encapsulation

A
  • 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
Q

Why is OOP easy to update and maintain

A

Because of its modularity

35
Q

Disadvantages of OOP

A

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
Q

Procedural

A

uses sequence of instructions that an be contained in procedure

37
Q

Advantages of oop inheritence

A

inheritance can be used to extend upon existing classes

38
Q

Advantages of oop debugging

A

Can be easier as encapsulation limits how attributes are changed

39
Q

OOp teamwork

A

Better for coding as a part of a team as classes can be distributed between teams