{"id":97698,"date":"2020-10-26T14:25:19","date_gmt":"2020-10-26T11:25:19","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/heres-why-developers-are-in-love-with-functional-programming\/"},"modified":"2020-10-26T14:25:19","modified_gmt":"2020-10-26T11:25:19","slug":"heres-why-developers-are-in-love-with-functional-programming","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/heres-why-developers-are-in-love-with-functional-programming\/","title":{"rendered":"#Here\u2019s why developers are in love with functional programming"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2ebe20ccaf8\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2ebe20ccaf8\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/heres-why-developers-are-in-love-with-functional-programming\/#Its_all_about_killing_side_effects\" >It\u2019s all about killing side effects<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/heres-why-developers-are-in-love-with-functional-programming\/#Being_dishonest_about_functions\" >Being dishonest about functions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/heres-why-developers-are-in-love-with-functional-programming\/#Functional_programming_is_writing_pure_functions\" >Functional programming is writing pure functions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/heres-why-developers-are-in-love-with-functional-programming\/#What_functional_programming_is_not_only\" >What functional programming is not (only)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/heres-why-developers-are-in-love-with-functional-programming\/#Some_languages_are_getting_more_functional_than_others\" >Some languages are getting more functional than others<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/heres-why-developers-are-in-love-with-functional-programming\/#Big_data_is_coming_And_its_bringing_a_friend_functional_programming\" >Big data is coming. And it\u2019s bringing a friend: functional programming.<\/a><\/li><\/ul><\/nav><\/div>\n<p>&#8220;<strong>#Here\u2019s why developers are in love with functional programming<\/strong>&#8221;<\/p>\n<div>\n                            Functional programming has been around for the <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" class=\"de in\" href=\"https:\/\/www.cs.kent.ac.uk\/people\/staff\/dat\/tfp12\/tfp12.pdf\">last 60 years<\/a>, but so far it\u2019s always been a niche phenomenon. Although <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/game\/\" data-internallinksmanager029f6b8e52c=\"7\" title=\"Game\" target=\"_blank\" rel=\"noopener\">game<\/a>-changers like Google rely on its <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" class=\"de in\" href=\"https:\/\/www.joelonsoftware.com\/2006\/08\/01\/can-your-programming-language-do-this\/\">key concepts<\/a>, the average programmer of today knows little to nothing about it.<\/p>\n<p>That\u2019s about to change. Not only are languages like <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" class=\"de in\" href=\"http:\/\/tutorials.jenkov.com\/java-functional-programming\/index.html\">Java<\/a> or <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" class=\"de in\" href=\"https:\/\/docs.python.org\/3\/howto\/functional.html\">Python<\/a> adopting more and more concepts from functional programming. Newer languages like Haskell are going completely functional.<\/p>\n<p>In simple terms, functional programming is all about building functions for immutable variables. In contrast, object-oriented programming is about having a relatively fixed set of functions, and you\u2019re primarily modifying or adding new variables.<\/p>\n<p>Because of its nature, functional programming is great for in-demand tasks such as data analysis and machine learning. This doesn\u2019t mean that you should say goodbye to object-oriented programming and go completely functional instead. It is useful, however, to know about the basic principles so you can use them to your advantage when <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>ropriate.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Its_all_about_killing_side_effects\"><\/span>It\u2019s all about killing side effects<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To understand functional programming, we need to understand functions first. This might sound boring, but at the end of the day, it\u2019s pretty insightful. So keep reading.<\/p>\n<p>A function, naively stated, is a thing that transforms some input into some output. Except that it\u2019s not always that simple. Consider this function in Python:<\/p>\n<figure class=\"post-image post-mediaBleed alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1325344 lazy\" alt=\"\" width=\"790\" height=\"83\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" src=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.53.png\" data-lazy=\"true\" srcset=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.53.png 1348w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.53-280x29.png 280w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.53-540x57.png 540w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.53-270x28.png 270w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.53-796x84.png 796w\"\/><\/figure>\n<p>This function is dumb and simple; it takes one variable x, presumably an int, or perhaps a float or double, and spits out the square of that.<\/p>\n<p>Now consider this function:<\/p>\n<figure class=\"post-image post-mediaBleed alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1325345 lazy\" alt=\"\" width=\"792\" height=\"137\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" src=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.57.png\" data-lazy=\"true\" srcset=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.57.png 1340w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.57-280x48.png 280w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.57-540x93.png 540w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.57-270x47.png 270w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.28.57-796x138.png 796w\"\/><\/figure>\n<p>At the first glance, it looks like the function takes a variable x, of whichever type, and returns nothing since there is no return statement. But wait!<\/p>\n<p>The function wouldn\u2019t work if global_list hadn\u2019t been defined beforehand, and its output is that same list, albeit modified. Even though global_list was never declared as an input, it changes when we use the function:<\/p>\n<figure class=\"post-image post-mediaBleed alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1325346 lazy\" alt=\"\" width=\"786\" height=\"103\" sizes=\"auto, (max-width: 786px) 100vw, 786px\" src=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.04.png\" data-lazy=\"true\" srcset=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.04.png 1352w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.04-280x37.png 280w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.04-540x71.png 540w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.04-270x36.png 270w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.04-796x105.png 796w\"\/><\/figure>\n<p>Instead of an empty list, this returns [1,2]. This shows that the list is indeed an input of the function, even though we weren\u2019t explicit about it. And that could be a problem.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Being_dishonest_about_functions\"><\/span>Being dishonest about functions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>These implicit inputs \u2014 or outputs, in other cases \u2014 have an official name: side effects. While we were only using a simple example, in more complex programs these can cause <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" class=\"de in\" href=\"http:\/\/blog.jenkster.com\/2015\/12\/what-is-functional-programming.html\">real difficulties<\/a>.<\/p>\n<p><em>[Read: <span class=\"c-message_attachment__title\"><span dir=\"auto\">What audience intelligence data tells us about the 2020 US presidential election<\/span>]<\/span><\/em><\/p>\n<p>Think about how you would test append_to_list: Instead of just reading the first line and testing the function with any x, you need to read the whole definition, understand what it\u2019s doing, define global_list, and test it that way. What\u2019s simple in this example can quickly become tedious when you\u2019re dealing with programs with thousands of lines of code.<\/p>\n<p>The good <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/news\/\" data-internallinksmanager029f6b8e52c=\"2\" title=\"News\" target=\"_blank\" rel=\"noopener\">news<\/a> is that there is an easy fix: being honest about what the function takes as an input. This is much better:<\/p>\n<figure class=\"post-image post-mediaBleed alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1325347 lazy\" alt=\"\" width=\"790\" height=\"240\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" src=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.09.png\" data-lazy=\"true\" srcset=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.09.png 1328w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.09-280x85.png 280w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.09-540x164.png 540w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.09-270x82.png 270w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.30.09-796x242.png 796w\"\/><\/figure>\n<p>We haven\u2019t really changed much. The output is still [1,2], and everything else remains the same, too.<\/p>\n<p>We have changed one thing, however: the code is now free of side effects. And that\u2019s great news.<\/p>\n<p>When you now look at the function declaration, you know exactly what\u2019s going on. Therefore, if the program isn\u2019t behaving as expected, you can easily test each function on its own and pinpoint which one is faulty.<\/p>\n<figure class=\"post-image post-mediaBleed aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"zf zg ds hx dt hy s c lazy\" alt=\"Woman sitting on couch with MacBook on her lap\" width=\"602\" height=\"902\" src=\"https:\/\/miro.medium.com\/max\/8032\/1*y4YcKl8i0kdfPyB19pkSVQ.jpeg\" data-lazy=\"true\"\/><figcaption><a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/thenextweb.com\/syndication\/2020\/10\/26\/heres-why-developers-are-in-love-with-functional-programming\/#\" data-url=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fthenextweb.com%2Fsyndication%2F2020%2F10%2F26%2Fheres-why-developers-are-in-love-with-functional-programming%2F&amp;via=thenextweb&amp;related=thenextweb&amp;text=Check out this picture on: Keeping your functions pure is keeping them maintainable. Photo by Christina @ wocintechchat.com on Unsplash\" data-title=\"Share Keeping your functions pure is keeping them maintainable. Photo by Christina @ wocintechchat.com on Unsplash on Twitter\" data-width=\"685\" data-height=\"500\" class=\"post-image-share popitup\" title=\"Share Keeping your functions pure is keeping them maintainable. Photo by Christina @ wocintechchat.com on Unsplash on Twitter\"><i class=\"icon icon--inline icon--twitter--dark\"\/><\/a>Keeping your functions pure is keeping them maintainable. Photo by Christina @ wocintechchat.com on <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/unsplash.com\/collections\/10472559\/dc%2Frwa?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Unsplash<\/a><\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Functional_programming_is_writing_pure_functions\"><\/span>Functional programming is writing pure functions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A function with clearly declared in- and outputs is one without side effects. And a function without side effects is a pure function.<\/p>\n<p>A very simple definition of functional programming is this: writing a program only in pure functions. Pure functions never modify variables, but only create new ones as an output. (I cheated a bit in the example above: it goes along the lines of functional programming, but still uses a global list. You can find <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" class=\"de in\" href=\"https:\/\/stackoverflow.com\/questions\/44036657\/side-effects-in-python\">better examples<\/a>, but it was about the basic principle here.)<\/p>\n<p>Moreover, you can expect a certain output from a pure function with a given input. In contrast, an impure function may depend on some global variable; so the same input variables may lead to different outputs if the global variable is different. The latter can make debugging and maintaining code a lot harder.<\/p>\n<p>There\u2019s an easy rule to spot side effects: as every function must have some kind of in- and output, function declarations that go without any in- or output must be impure. These are the first declarations that you might want to change if you\u2019re adopting functional programming.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_functional_programming_is_not_only\"><\/span>What functional programming is not (only)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Map and reduce.<\/p>\n<p>Loops are not a thing in functional programming. Consider these Python loops:<\/p>\n<figure class=\"post-image post-mediaBleed alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1325348 lazy\" alt=\"\" width=\"780\" height=\"380\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" src=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.06.png\" data-lazy=\"true\" srcset=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.06.png 1344w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.06-280x136.png 280w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.06-540x263.png 540w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.06-270x131.png 270w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.06-796x387.png 796w\"\/><\/figure>\n<p>For the simple operations that you\u2019re trying to do, this code is rather long. It\u2019s not functional, either, because you\u2019re modifying global variables.<\/p>\n<p>Instead, consider this:<\/p>\n<figure class=\"post-image post-mediaBleed alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1325349 lazy\" alt=\"\" width=\"799\" height=\"204\" sizes=\"auto, (max-width: 799px) 100vw, 799px\" src=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.42.png\" data-lazy=\"true\" srcset=\"https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.42.png 1388w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.42-280x71.png 280w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.42-540x138.png 540w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.42-270x69.png 270w, https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/Schermata-2020-10-26-alle-11.33.42-796x203.png 796w\"\/><\/figure>\n<p>This is fully functional. It\u2019s shorter. It\u2019s faster because you\u2019re not iterating through many elements of an array. And once you\u2019ve understood how filter, map, and reduce work, the code isn\u2019t much harder to understand either.<\/p>\n<p>That <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" class=\"de in\" href=\"http:\/\/blog.jenkster.com\/2015\/12\/which-programming-languages-are-functional.html#fnref:1\">doesn\u2019t mean<\/a> that all functional code uses map, reduce, and the likes. It doesn\u2019t mean that you need functional programming to understand map and reduce, either. It\u2019s just that when you\u2019re abstracting loops, these functions pop up rather a lot.<\/p>\n<p><strong>Lambda functions<\/strong><\/p>\n<p>When talking about the history of functional programming, many start with the invention of lambda functions. But although lambdas are without doubt a cornerstone of functional programming, they\u2019re not the root cause.<\/p>\n<p>Lambda functions are tools that can be used to make a program functional. But you can use lambdas in object-oriented programming, too.<\/p>\n<p><strong>Static typing<\/strong><\/p>\n<p>The example above isn\u2019t statically typed. Yet it is functional.<\/p>\n<p>Even though static typing adds an extra layer of security to your code, it isn\u2019t essential to make it functional. It can be a nice addition, though.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Some_languages_are_getting_more_functional_than_others\"><\/span>Some languages are getting more functional than others<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>Perl: <\/strong>Perl takes a very different approach to side effects than most programming languages. It includes a magic argument, $_, which makes side effects one of its core features. Perl does have its virtues, but I wouldn\u2019t try functional programming with it.<\/p>\n<p><strong>Java: <\/strong>I wish you good luck with writing functional code in Java. Not only will half of your program consist of static keywords; most other Java developers will also call your program a disgrace. That\u2019s not to say that Java is bad. But it\u2019s not made for those problems that are best solved with functional programming, such as database management or machine learning applications.<\/p>\n<p><strong>Scala: <\/strong>This is an interesting one: Scala\u2019s goal is to unify object-oriented and functional programming. If you find this kind of odd, you\u2019re not alone: while functional programming aims at eliminating side effects completely, object-oriented programming tries to keep them inside objects. That being said, many developers see Scala as a language to help them transition from object-oriented to functional programming. This may make it easier for them to go fully functional in the years to come.<\/p>\n<p><strong>Python: <\/strong>Python actively encourages functional programming. You can see this by the fact that every function has, by default, at least one input, self. This is very much \u00e0 la the <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" class=\"de in\" href=\"https:\/\/www.python.org\/dev\/peps\/pep-0020\/\">Zen of Python<\/a>: explicit is better than implicit!<\/p>\n<p><strong>Clojure: <\/strong>According to its creator, Clojure is about 80% functional. All values are immutable by default, just like you need them in functional programming. However, you can get around that by using mutable-value wrappers around these immutable values. When you open such a wrapper, the thing you get out is immutable again.<\/p>\n<p><strong>Haskell: <\/strong>This is one of the few languages that are purely functional and statically typed. While this might seem like a time-drainer during development, it pays off big when you\u2019re debugging a program. It\u2019s not as easy to learn as other languages, but it\u2019s definitely worth the investment!<\/p>\n<figure class=\"post-image post-mediaBleed aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"zf zg ds hx dt hy s c lazy\" alt=\"Man on leather couch with laptop\" width=\"690\" height=\"460\" src=\"https:\/\/miro.medium.com\/max\/12564\/1*VBP29x3rYenflFKGWC7bFA.jpeg\" data-lazy=\"true\"\/><figcaption><a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/thenextweb.com\/syndication\/2020\/10\/26\/heres-why-developers-are-in-love-with-functional-programming\/#\" data-url=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fthenextweb.com%2Fsyndication%2F2020%2F10%2F26%2Fheres-why-developers-are-in-love-with-functional-programming%2F&amp;via=thenextweb&amp;related=thenextweb&amp;text=Check out this picture on: This is yet the beginning of the era of big data. Photo by Austin Distel on Unsplash\" data-title=\"Share This is yet the beginning of the era of big data. Photo by Austin Distel on Unsplash on Twitter\" data-width=\"685\" data-height=\"500\" class=\"post-image-share popitup\" title=\"Share This is yet the beginning of the era of big data. Photo by Austin Distel on Unsplash on Twitter\"><i class=\"icon icon--inline icon--twitter--dark\"\/><\/a>This is yet the beginning of the era of big data. Photo by Austin Distel on <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/unsplash.com\/collections\/9967779\/ielts?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Unsplash<\/a><\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Big_data_is_coming_And_its_bringing_a_friend_functional_programming\"><\/span>Big data is coming. And it\u2019s bringing a friend: functional programming.<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In comparison to object-oriented programming, functional programming is still a niche phenomenon. If the inclusions of functional programming principles in Python and other languages are of any significance, however, then functional programming seems to be gaining traction.<\/p>\n<p>That makes perfect sense: functional programming is great for big databases, parallel programming, and machine learning. And all these things have been booming over the last decade.<\/p>\n<p>While object-oriented code has uncountable virtues, those of functional code, therefore, shouldn\u2019t be neglected. Learning some basic principles can often be enough to up your game as a developer and be ready for the future.<\/p>\n<hr\/>\n<p><em>This article was written by <span data-sheets-value=\"{\" moutafis=\"\" data-sheets-userformat=\"{\">Rhea Moutafis<\/span> and was originally published on <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/towardsdatascience.com\/\">Towards Data Science<\/a>. You can read it <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/towardsdatascience.com\/why-developers-are-falling-in-love-with-functional-programming-13514df4048e\">here<\/a>.\u00a0<\/em><\/p>\n<\/p><\/div>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong>\n<\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener noreferrer\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/thenextweb.com\/syndication\/2020\/10\/26\/heres-why-developers-are-in-love-with-functional-programming\/\" target=\"_blank\" rel=\"noopener noreferrer\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#Here\u2019s why developers are in love with functional programming&#8221; Functional programming has been around for the last 60 years, but so far it\u2019s always been a niche phenomenon. Although game-changers like Google rely on its key concepts, the average programmer of today knows little to nothing about it. That\u2019s about to change. Not only are&#8230;<\/p>\n","protected":false},"author":1,"featured_media":97699,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/img-cdn.tnwcdn.com\/image\/tnw?filter_last=1&fit=1280,640&url=https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2020\/10\/1-18.jpg&signature=56195b22d2b530e5336cbe1e6b31f8f7","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[70759],"class_list":["post-97698","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-tech"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/97698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=97698"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/97698\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/97699"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=97698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=97698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=97698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}