Notes on a talk by Patrick Delancy at Iowa Code Camp.
If you don't practice it, you lose it.
The inability to learn programming languages could force you to change careers.
The idioms and concepts you learn will help you with your current language.
Start with the underlying principles. Understand the paradigms. The rest is just syntax.
Programming Paradigms (in order of complexity, low to high)
- Object Oriented
That's not the order in which we typically learn them.
- Global/Static Variables
- Lexical Scoping
- Text in your code defines variable scope
- Not based on time (such as global after you define it)
- Block scoping, function scoping, etc.
- Making something simpler.
- We don't have to understand how it works.
- An object, if it exists, should never be in an invalid state.
Very domain-driven. Easy to translate the business needs.
- Functions as values
- Lambdas, anonymous delegates
- Pattern Matching
- Regular expressions
- Define shape of a value or object
- Compiler can warn you of missing cases
- Partial Application
- Monad/Computation Expression
- Binding functions together and defining how they behave
- Helps to solve the problem of side effects (like I/O)
- A function plus its referencing environment
- Such as the memory address of a variable
- Necessary evil (avoids globals)
- Pull out variables from object (often through pattern matching)
- Lists are head + tail
- Tail recursion avoids running out of stack
- Cons constructs a new value from two inputs
- Linked lists
What is the shape of the process?
Focus on behavior, not data.
Languages don't fit into these buckets anymore.
They steal ideas from other paradigms.