Map & Lambda in Google Sheets
Google launched today some very cool function that reminded me of Mathematica notation. As you can check here in Google Sheets Docs, I believe this could be great to help people get used to the Functional Program Style.
Google launched today some very cool function that reminded me of Mathematica notation. As you can check here in Google Sheets Docs, I believe this could be great to help people get used to the Functional Program Style.
As a matter of fact, Mathematica & Wolfram Language have been using functional programming since the beginning.
Many popular OO languages have now functional programming capabilities, such as:
Where now lambdas, map, reduce, lists, filters, pure function, parallelize and others are getting really popular.
Functional programming makes the code more readable, with no need for for or while loops that require counters and control variables to handle the loop. And in addition, you never have that classic index out of bound kind of error, because the functions run on the lists (data)!!
Moreover, functional programming is a key feature for parallel processing, such as with Apache Hadoop (HDFS) or Apache Spark in Big Data context. Where terabytes of data are spread in lots of files in servers, usually with text data in different formats (data lake).
To find something in this mass of data, a functional programming code can run in different servers (nodes) and then consolidate all the data back to the user.
Example code from Apache Spark:
Source: Examples | Apache Spark
I think that Wolfram Language brings up-front features that are now available in many different programming languages, even in Elixir you can see features that perhaps are inspired by Mathematica.
We can note that Java is inspired in C and Smalltalk, and JavaScript inspired in Java, Wolfram Language has something from Lisp, and so on…
If some new language or tech gets inspired by Wolfram, they are in a good shape! ![]()