What is Functional Programming? An Overview - part 3
So what about applying these functional concepts we have been discussing in programming languages? Fortunately, most modern general purpose languages support many aspects of functional programming; JavaScript, Python, Golang, PHP, etc. There are also quite a few languages that force you to program in a function way. These include, Haskell, Erlang, Clojure, and F#.
Languages
What makes these languages function? And what are the requirements for a language to be able to do functional programming?
Here are the two bare-minimum requirements:
Higher-order Functions
Higher-order functions are function that either take in a function as an argument or return a function in the return statement. You cannot implement a functional programming paradigm without this.
First Class Functions
First class functions are functions that are stored as variables with the type Function. This allows them to be passed around into other functions, the same way you would with variables. If you are using a modern programming language, then you probably already do this without thinking about it.
Immutability, recursion, and the features I mentioned in previous posts are nice to have if you are going to go all-in with programming in a functional manner; but, again, not totally necessary.
I hope you enjoyed this article! Don't forget to subscribe for weekly updates on all of the programming content I create.
See you next week!