Vad är given in BDD context?
Stubbar return värde. Står för behavior driven development
What is side effects?
Common side effects are changing objects or variables in place, printing to the console, writing to a log file or to a database. Side-effects are considered harmful if they affect the semantics of our program in an undesirable way.
Referential transparency
In analytic philosophy and computer science, referential transparency and referential opacity are properties of linguistic constructions,[a] and by extension of languages. A linguistic construction is called referentially transparent when for any expression built from it, replacing a subexpression with another one that denotes the same value[b] does not change the value of the expression.
When is a function called pure?
A function is called pure if all expressions involved are referentially transparent.
1.3.1 Mutable data structures
What are the main concept that java collections framework is built upon?
We encapsulate state in objects to achieve data hiding and provide mutator methods to control the state
What is either .fold
Signature (conceptually):
fold(
onLeft: (L) -> T,
onRight: (R) -> T
) -> T
If the Either is Left, onLeft is executed
If the Either is Right, onRight is executed
Both must return the same type T
fold returns that T