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 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!