Functional vs. Imperative, Declarative, and Procedural Programming
Before talking about functional programming you have to talk about imperitive, declarative, and procedural programming.
In a nutshell:
Imperative programming is like a recipe book. It’s a list of things you are telling the computer to do (e.g. 1. Add flower, 2. Mix 2 eggs).
Declarative programming is a lot like SQL. You aren’t concerned as much with how you want the computer to get there as much as you are telling the computer what to do. The program figures out the best way to get to the solution that you want.
Procedural programming is a lot like functional programming, but one step removed. Procedural programming allows for usage of functions, and most imperative languages allow for this now.
Functional programming is different than procedural programming because everything is within a function. Variables only exist in the function. Functions are used as variables. This allows for recursion to happen so that loops are not needed (because you are taking advantage of other methods that are functions).
In the end, it seems like a lot of languages have allowances for different programming paradigms, but I found this to be a helpful time spent getting a little more clarity of the differences.