The very idea of React is a sequence of function calls to manipulate a tree-like data structure called the DOM tree (i.e., a Web page). Functions are being called one after another and the result is a new representation of the DOM tree finally reflected in the user interface. The user interface is a pure function and therefore it is also called the ”referentially transparent UI” by the creators of React.
According to the creators of React ”React essentially manages to abstract away the DOM, thus simplifying the programming model while also in a somewhat surprising turn improving performance.” The resulting code has somewhat functional look and feel. Manipulating the DOM tree is hidden and classes are replaced by functions. The concepts introduced by the library not only highlight the power of pure functions but also guide the developer to keep one’s concerns separate and solutions composable.
The utilities have become less useful over the last few years. The argument draws on the fact that the concepts introduced by the libraries have been adopted in ECMAScript version 6.
Ramda’s is a useful tool for dealing with data, but also for learning functional programming. A glimpse on Ramda documentation reveals a real world attempt to provide a generic functional programming library instead of a functional programming toolkit. The following citation from Ramda documentation reveals the goal of being positioned as a generic FP JS library – ”There are already several excellent libraries with a functional flavor. Typically, they are meant to be general-purpose toolkits, suitable for working in multiple paradigms. Ramda has a more focused goal. We wanted a library designed specifically for a functional programming style, one that makes it easy to create functional pipelines, one that never mutates user data”. Ramda’s functions are automatically curried, which is useful for learning to design partially applied and reusable functions.
With this summary of how well React supports learning of functional programming our two men training team is gradually saying farewell to our students as they start their company internships in mid February 2021. We are grateful for all students for their hard work and persistent efforts during the theory period of the training course.
Also, we are happy to announce that some of the companies who have provided the internships for our students have shown interest in having their software development staff being introduced to functional programming.
Let’s spread the ”F” word and keep warm!
Selma the dog and the rest of the team
PS. It was fun to have a former student of the University of Nottingham on our training course. She recalled Graham Hutton’s interest in functional programming and was certainly delighted to see that our training course included fp topics, too.
Dogs need to keep war, too!