Programming Pradigm Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an imperative program?

A

Programming languages based on the imperative paradigm make use of assignments or statements which are written to and, therefore, change the state of computer memory; imperative languages can be translated into efficient machine code.

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

Give an example of an imperative paradigm?

A
  • procedural programming.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a functional paradigm?

A

The functional paradigm uses programming languages that evaluate mathematical functions, rather than the imperative method where values are assigned to variables; to summarise, variables are determined by calling functions.

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

What are functional programs used for?

A

Functional programs are used to solve problems in complex structures where the code created is brief and it is, therefore, easier to determine errors

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

What is a logic paradigm?

A

The logic paradigm is especially useful in solving problems that involve querying and gaining knowledge from declared facts and their rules.

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

What is Prolog?

A

Prolog is a declarative logic programming language that is widely used in artificial intelligence and in expert system applications; it is useful for rule-based systems

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

What is object orientated paradigm?

A

The object-oriented paradigm is based on data structures known as objects; these objects are members of a class which are grouped into a class hierarchy.

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

What is an Function?

A

A function can be defined as a relation between input values from the domain to a set of possible outputs from the codomain, in which each input is related to exactly one output

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

What is a first class object?

A

A first-class object is a language object which supports the operations normally available to other entities

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

What entities are first class objects available to?

A
  • appearing in expressions
  • being assigned to a variable
  • being used as an argument for a function
  • being returned as an output from a function call
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What can first class objects consist of?

A

In many programming languages, first-class objects can consist of the following: integers, floating-point values, characters and strings.

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

Why do functional programs make use of high order functions and first class objects?

A

Functional programming makes use of higher-order functions and first-class objects, since they can be used as an argument for another function and as the result of a function call.

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

What is Function application?

A

Function application is the process of providing a function with an input value from its domain to determine an output from its codomain

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

What is partial function application?

A

Partial function application can be applied to a function that requires more than one argument; this can then be processed by applying the function with some but not all of the arguments needed. A new function is then created to carry out the final part of the function.

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

What is Composition of Functions?

A

Composition of functions is the process of combining two functions by applying the results of one function to another.

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

Where is composition of functions used?

A

This technique is widely used in functional programming, where complex functions can be constructed by using simpler functions