2. Imperative programming
● Imperative programming is a programming paradigm that uses statements
that change a program's state
○ Statements: conditional statements, loop statements, algorithms, control flow
○ You tell the computer how to do things - low level instructions closer to hardware
○ Higher cyclomatic complexity, less cleaner code, more difficult to test
● Real world example: hey waiter, I want to order a salad, but if the cheese is
too salted then please don’t add olives. Instead you could add more corn!
3. Declarative programming
● Is a programming paradigm that expresses the logic of a computation without
describing its control flow
○ Less direct control, without going into implementation details!
○ Tell the computer what to do, without specifying how!
○ You create expressions instead of statements + evaluate functions
● Real world example: Hey waiter, I want to order a slightly salted salad!
7. Reactive programming
● Declarative event-based
● Subset of asynchronous programming where the availability of new
information drives the logic forward rather than having control flow driven by a
thread-of-execution
● It supports decomposing the problem into multiple discrete steps where
each can be executed in an asynchronous and non-blocking fashion, and
then be composed to produce a workflow (~ data streams)
● Contention is the biggest enemy of scalability. Reactive program should
rarely, if ever, have to block