Lecture 2 - FP Flashcards

1
Q

Imperative vs declarative

A

Imperative - procedural, OOP, how to compute

declarative - functional, logic, what to compute

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

What is meant by side effect

A

evaluating the same expression successively gives different answers

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

referential transparency

A

not having side effects, you can replace function with result without have an effect on the application

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

expression, comutation, value

A

expression - function, nested functions
computation - evaluation of an expression -> value
value - datatype element

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

Functional programming characteristics

A

no assignment - cannot change val of a variable

functions are values - functions can take in functions and can return list of functions

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

What does it mean that functions are deterministic

A

same input = same output

data is immutable

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