As programmers, we've all heard of them
- TLA+ 🤔
- common lisp
Weird sounding languages, with even weirder tag lines. Functional programming. Monads. Functors. Lenses 🕶? It's enough to overwhelm even the most curious programmers. There are a few things we can take away from these languages that don't sound incomprehensible.
Functional core, imperative shell
So this is something that got really popular, but it's good advice. It's really cool if you can pull it off to be able to test every bit of logic with very explicit arguments or really easily without a database or a filesystem or anything. That's pretty cool, and I think this gets lost in functional programming talks. The whole goal really is to make things easy to "reason about".
Separate behavior and state
This is in direct contrast to object oriented programming. The key here is to unlearn everything you've been taught in CS courses or bootcamps or whatever, everything. The data in your program will flow freely and it's a bit crazy, it seems like everything has a "God Object" and it's really bad practice coming from OOP, but the main difference in functional languages is the concept of immutability. You can re-define a var with the same name, but you can't change it once it's set. This is more specific to clojure than the others, but it's definitely one of the most disorienting things about learning the language.
Do less, achieve more
Another dig at OOP, but really it's something that needs to be said. No more objects with their own methods. Every bit of data can just be "data" similar to a hash map or a struct and the functions operate on it. Functional programming doesn't solve every problem (or even most problems), but what it does do, it does it well and it does a lot less, but gives you, the programmer a lot more in return.