Input data + Transformations + Output data = Algorithm
-
imperative programming: we tell the computer what we want and how it should be done, step by step
- there's a lot of room for errors
- verbose
- understanding the algorithm is more difficult because of its complexity
- when reading the code we have to go back and forth (e.g. when reading a loop)
-
declarative programming: we tell the computer what we want but not how to do it
- the algorithm resembles the problem statement
- more concise
- less room for errors
- we understand what the algorithm does by reading it in one pass
- a List is like a bucket - it holds data
- a List is a data structure
- a Stream is like a pipeline - it doesn't hold data, but it lets data flow through it
- a Stream is not a data structure, it's an abstraction of the operations we apply to the data
Coming soon...