Lecture 2 - FP Flashcards
Imperative vs declarative
Imperative - procedural, OOP, how to compute
declarative - functional, logic, what to compute
What is meant by side effect
evaluating the same expression successively gives different answers
referential transparency
not having side effects, you can replace function with result without have an effect on the application
expression, comutation, value
expression - function, nested functions
computation - evaluation of an expression -> value
value - datatype element
Functional programming characteristics
no assignment - cannot change val of a variable
functions are values - functions can take in functions and can return list of functions
What does it mean that functions are deterministic
same input = same output
data is immutable