Functional Programming (FP) styles are generally preferred to Object Orientated (OO). FP programs have two major advantages: they are much easier to test and they scale much better.
Even if you are programming as an OO programmer you will be a better programmer if you know FP
Basics
- Single Responsibility Functions
- Immutable State
- Focus on how to cleanly compose functions, and how to test these compositions
- Learn how to use the builtin higher order functions.
- Functions should avoid side effects, and there should be clean separation of pure and impure functions
- Prefer protocols/types classes to inheritance
Unlike object orientated guidelines, I was unable to find an equivalent of SOLID. The following are slightly opinionated (and their reasoning explained). As these are opinionated, in a project you can take different guidelines, but please be aware of the reasons
Advanced topics
- DSLs are encouraged
- Avoid Monadic Transformers
- Prefer Kleisli’s to Monads