Does functional programming matters?

Yes, but is just a part of the story. For me, it seems like functional programming is “advertized” by its fervor protagonists as being the holy grail. …Well, well, well …However there is a big issue based on a very simple down to earth concept: functional programming is based on “computing” something, just like mathematical functions and avoiding state at all means. The issue is that the systems we usually want to model are quite the opposite: they are usually extremely stateful. We want to store data and to modify it over time, it is “information” technology, to store and handle “information”. This leads to the widespread use of databases and SQL. They store the state and are thus the core of the business. On the opposite, functional programming doesn’t lend itself well to play around with data structures. Sure it can, but not in an as straightforwad and convinient way as for imperative stateful languages.

What I want to say with this is that they have complementary uses. Imperative constructs are perfect to handle everything about the state. Updating data and handling how information is structured and modified. On the opposite, functional programming makes the perfect candidate to get data in a certain format, to vizualize it, to extract relevant informations from it or to compute new results from it. Imperative and functional are like the controller and the viewer. Perhaps stressing more clearly which parts of the program are functions to vizualize/compute things based on the data and which parts of the program are procedures in order to modify the data would help software development. By making the frontier more clearer, we would help producing clearer code, having less side effects and being more …may I say “adequate”.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: