{"id":11482,"date":"2022-07-13T07:00:15","date_gmt":"2022-07-13T14:00:15","guid":{"rendered":"https:\/\/www.codingdojo.com\/blog\/?p=11482"},"modified":"2024-10-30T18:27:15","modified_gmt":"2024-10-31T01:27:15","slug":"what-is-functional-programming","status":"publish","type":"post","link":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming","title":{"rendered":"What Is Functional Programming and Why Use It?"},"content":{"rendered":"\r\n<p>If you\u2019ve just <a href=\"https:\/\/www.codingdojo.com\/blog\/how-to-start-coding\">started learning how to code<\/a>, deciding which programming paradigm and <a href=\"https:\/\/www.codingdojo.com\/blog\/easiest-programming-language-to-learn\">programming language to learn first<\/a> can be tricky.\u00a0\u00a0<\/p>\r\n\r\n\r\n\r\n<p>If you want to master a programming paradigm relevant to today\u2019s tech landscape, consider going with functional programming. It\u2019s a simplified, cleaner, and more predictable way to create code. Your resulting code is also easier to test and maintain.<\/p>\r\n\r\n\r\n\r\n<p>But what exactly is functional programming? Read on to learn more about this programming paradigm, its advantages, and the most popular functional programming languages.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">What Is Functional Programming?<\/h2>\r\n\r\n\r\n\r\n<p>Functional programming (FP) is an approach to software development that uses pure functions to create maintainable software. In other words, building programs by applying and composing functions.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Functional programming harnesses language support by using functions as variables, arguments, and return values\u2014creating elegant and clean code in the process. FP also uses immutable data and avoids concepts like shared states. This is in contrast to object-oriented programming (OOP), which uses mutable data and shared states.<\/p>\r\n\r\n\r\n\r\n<p>Functional programming languages focus on declarations and expressions rather than the execution of statements. Functions are also treated like first-class citizens\u2014meaning they can pass as arguments, return from other functions, and attach to names.<\/p>\r\n\r\n\r\n\r\n<p>FP focuses on the results, not the process, while iterations like loop statements and conditional statements (e.g., If-Else) aren\u2019t supported.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>FP evolved from <a href=\"https:\/\/plato.stanford.edu\/entries\/lambda-calculus\/\">the lambda calculus (<em>\u03bb<\/em>-calculus)<\/a>, a simple notation for functions and applications that mathematician Alonzo Church developed in the 1930s. Many programming languages and dialects use the functional paradigm, including Scheme, Common Lisp (CL), and Elixir.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Many of <a href=\"https:\/\/www.codingdojo.com\/blog\/top-programming-languages\">today\u2019s top programming languages<\/a>\u2014including C#, Java, JavaScript, PHP, and Python\u2014support programming in a functional style or use features found in FP.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>The following section will discuss the difference between pure and impure functions in functional programming.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Pure Functional Programming<\/h3>\r\n\r\n\r\n\r\n<p>Purely functional programming is a subset of FP that treats all functions as deterministic mathematical or pure functions.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>In deterministic mathematical functions, the development of future states of the system does not allow any randomness. Pure functions, meanwhile, have function return values that are identical for identical arguments. The function application also has no side effects (i.e., it does not modify state variable values outside its local environment).\u00a0<\/p>\r\n\r\n\r\n\r\n<p>A side effect occurs in a program when you insert external code into your function. This prevents the function from properly performing its task. Impure functions, in contrast, contain one or more side effects.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>To see pure functions in action, refer to the following JavaScript code:<\/p>\r\n\r\n\r\n\r\n<p>function updateMyAddress(newAddress) {<\/p>\r\n\r\n\r\n\r\n<p>\u00a0\u00a0\u00a0const myAddress = [&#8220;ChurchSt&#8221;, &#8220;CovingtonCross&#8221;];<\/p>\r\n\r\n\r\n\r\n<p>\u00a0\u00a0\u00a0myAddresses[myAddresses.length] = newAddress;<\/p>\r\n\r\n\r\n\r\n<p>\u00a0\u00a0\u00a0return myAddresses;<\/p>\r\n\r\n\r\n\r\n<p>}<\/p>\r\n\r\n\r\n\r\n<p>updateMyAddress() doesn\u2019t need any external code to accomplish its tasks. This means it\u2019s a pure function.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Impure Functional Programming<\/h3>\r\n\r\n\r\n\r\n<p>To see impure functions in action, check out this JavaScript code:<\/p>\r\n\r\n\r\n\r\n<p>\u200b\u200bconst myAddresses = [&#8220;ChurchSt.&#8221;, &#8220;CovingtonCross&#8221;];<\/p>\r\n\r\n\r\n\r\n<p>function updateMyAddress(newAddress) {<\/p>\r\n\r\n\r\n\r\n<p>\u00a0\u00a0myAddresses.push(newAddress);<\/p>\r\n\r\n\r\n\r\n<p>\u00a0\u00a0return myAddresses;<\/p>\r\n\r\n\r\n\r\n<p>}<\/p>\r\n\r\n\r\n\r\n<p>updateMyAddess() is an impure function since it contains code (myAddress). This code mutates an external state, which gives updateMyAddress() some side effects.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Why Functional Programming Matters<\/h2>\r\n\r\n\r\n\r\n<p>While FP has generally been less popular than object-oriented programming, it has grown in popularity in recent years due to the rise of machine learning and big data. Functional programming is notable for its ability to efficiently parallelize pure functions. Code for data analysis workflows and tasks is easier to analyze, test, and maintain using the functional programming paradigm.<\/p>\r\n\r\n\r\n\r\n<p>Due to its pure nature, FP is ideally suited for analyzing extensive data sets and machine learning. Pure functions will always generate the same results, with no outside values to influence the final results.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Algorithms created using FP can also quickly identify and correct errors. Many programmers and software developers would rather work with a programming paradigm that is easy to debug because of its pure functions.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>As highlighted in a paper published by John Hughes of the University of Glasgow, functional programming plays a crucial role in future tech development because of its modularity. Modularity breaks down large and complex projects into simpler modules. You can test the modules separately, which lessens the amount of time spent on unit testing and debugging.<\/p>\r\n\r\n\r\n\r\n<p>\u201cFunctional programming languages provide two new kinds of glue \u2014 higher-order functions and lazy evaluation. Using these glues, one can modularize programs in new and useful ways,\u201d Hughes notes in his paper.\u00a0<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Advantages of Functional Programming<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><strong>Modularity<\/strong> &#8211; As previously mentioned, functional programming is highly modular. This makes the resulting code shorter and easier to read. Anyone who has tried to decipher monolithic code would appreciate the simplicity.\u00a0<\/li>\r\n<li><strong>You can implement lambda calculus in the program<\/strong> &#8211; You can use this to solve complex problems.\u00a0<\/li>\r\n<li><strong>Contains many functional constructs<\/strong> &#8211; These include lazy map, lazy evaluation, and lists.<\/li>\r\n<li><strong>Some programming languages support nested functions<\/strong> &#8211; This significantly improves the maintainability of the code.<\/li>\r\n<li><strong>Problems are easier to pinpoint and solve<\/strong> &#8211; FP\u2019s reliance on pure functions makes debugging and unit testing easier. Pure functions also prevent confusing issues and errors from developing in the code.<\/li>\r\n<li><strong>Keeps concurrency safe<\/strong> &#8211; Code is thread-safe when no two concurrent processes try to access the same data simultaneously. This bug is a race condition. Since pure functions never share a state with other sections of the program, race conditions can\u2019t occur.\u00a0<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">The 7 Core Functional Programming Concepts<\/h2>\r\n\r\n\r\n\r\n<p>To help you better understand the problems that functional programming can solve, let\u2019s look at the seven core functional programming concepts.<\/p>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li>Pure Functions<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<p>We\u2019ve already established that pure functions are deterministic and have no side effects. However, as noted in an article published in <em>Hackernoon<\/em> by Victor Cordova, the goal is <a href=\"https:\/\/hackernoon.com\/9-functional-programming-concepts-everyone-should-know-uy503u21\">not to create code that is completely devoid of side effects<\/a>.<\/p>\r\n\r\n\r\n\r\n<p>\u201cIt\u2019s important to understand we don\u2019t want to eliminate all side effects since all programs need to do some sort of side-effect such as calling <a href=\"https:\/\/www.codingdojo.com\/blog\/what-is-an-api\">APIs<\/a> or printing to some stdout. What we want is to minimize side effects, so our program\u2019s behavior is easier to predict and test,\u201d Cordova said.<\/p>\r\n\r\n\r\n\r\n<p>In the following code written by Cordova, a side effect (sessionIsActive) modifies a variable outside its scope. This is causing problems for the function caller.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/lh6.googleusercontent.com\/mgqfLv81hxjUNLME6Gbs11NvVeXaJbE3YoUH0BJOXbrQTN4ZAmtQS7Kk59mrn9GCOnQUEEBeDSIXeHK55Tlvgideh_AMaUA0ybMLdKH5IfGkGdEzVLZRd7ZfLEbTmPc-YY77wkjKS4oY4u809w\" alt=\"functional programming code\" width=\"623\" height=\"520\" \/><\/figure>\r\n\r\n\r\n\r\n<p><em>Alt Text=\u201dcode written using the functional paradigm with side effect\u201d<\/em><\/p>\r\n\r\n\r\n\r\n<p><em>Source: <\/em><a href=\"https:\/\/hackernoon.com\/9-functional-programming-concepts-everyone-should-know-uy503u21\"><em>Hackernoon<\/em><\/a><\/p>\r\n\r\n\r\n\r\n<p>In the second screenshot, it\u2019s modified code, and the side effect is gone. The function caller can now perform the task without any issues.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/lh4.googleusercontent.com\/VlODE0_VIpWNPrheJ-LP9oVk9eYnV3GUal5RZ_QYxCEYmBjsj2vhewkonbLu1QU4DpvAkJwr5ALo5N_MwPjXgUEmXp6gtW4pwniU8g0N3N4ZVwgpRb3NCfVFtfO_jA7M4IN6jMCmq7fvgo_RBQ\" alt=\"functional programming modified code\" width=\"552\" height=\"619\" \/><\/figure>\r\n\r\n\r\n\r\n<p><em>Alt Text=\u201dcode written using the functional paradigm without side effects\u201d<\/em><\/p>\r\n\r\n\r\n\r\n<p><em>Source: <\/em><a href=\"https:\/\/hackernoon.com\/9-functional-programming-concepts-everyone-should-know-uy503u21\"><em>Hackernoon<\/em><\/a><\/p>\r\n\r\n\r\n\r\n<h3>2. First-Class Functions<\/h3>\r\n\r\n\r\n\r\n<p>Another key benefit of first-class functions is that there are <strong>no limits and restrictions on how to use functions<\/strong>. In other words, they behave like any other variable.<\/p>\r\n\r\n\r\n\r\n<p>First-class functions lay the groundwork for other modifications, like currying, higher-order functions, and closures.\u00a0<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">3. Higher-Order Functions<\/h3>\r\n\r\n\r\n\r\n<p>Higher-order functions take functions as an argument or return the functions. Aside from modularizing programs, you can also use higher-order functions to make functions polymorphic (i.e., allows for the use of a single code multiple times).<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">4. Immutability\u00a0<\/h3>\r\n\r\n\r\n\r\n<p>Immutable objects do not change. In FP, you initialize and implement objects and values without changing their values or state. You can create new objects and values if necessary, but you can\u2019t modify an existing object or value\u2019s state.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Functional programming\u2019s immutability aligns with a key principle of mathematics\u2014that objects can\u2019t change their state. This principle is evident in even the most basic mathematical formulas.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Immutability prevents problems from arising and spreading in your code. In a multithreaded application, a thread can act on an immutable object without altering the other threads since no one is modifying the object. In concurrent applications, this prevents errors in your code.\u00a0<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">5. Recursion<\/h3>\r\n\r\n\r\n\r\n<p>Recursion takes place when a function calls itself. A recursive function executes code and repeatedly runs the function until it meets an exit condition. You can find this pattern in a standard loop: the loop declares an initial variable and executes the code to be done with the variable. This continues until it meets a stopping or exit condition.<\/p>\r\n\r\n\r\n\r\n<p>You can use a recursion instead of a loop. However, a loop can never substitute for a recursion.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Here are some key points to using recursive functions in your JavaScript code:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Recursion often gets the job done properly when sorting tree structures (i.e., node relationships).<\/li>\r\n<li>If you find yourself repeatedly nesting loops within loops, a recursive function can help you extract data and reuse the function for different trees. For a more in-depth explanation, check out this <a href=\"https:\/\/medium.com\/weekly-webtips\/simplifying-functional-programming-with-recursion-javascript-aa7007f4b159\">tutorial on using recursive functions in JavaScript<\/a>.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">6. Function Composition<\/h3>\r\n\r\n\r\n\r\n<p>Function composition allows you to combine pure functions to create more complicated ones. The same principle applies in mathematics: the result of one function continues as the argument of the following function, and the result of the last function is the result of the whole.<\/p>\r\n\r\n\r\n\r\n<p>In coding, we can combine multiple steps into a single code line or into a new function.\u00a0<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">7. Referential Transparency<\/h3>\r\n\r\n\r\n\r\n<p>Referential transparency allows a value to replace its expression in a program (or anything with the same value). This happens without changing the result of the program. This logic dictates that methods should always return the same values for given arguments without additional effects.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Referential transparency makes reasoning about programs a more straightforward process. It renders each subprogram independent, which dramatically simplifies refactoring and unit testing.<\/p>\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Object-Oriented Programming vs Functional Programming<\/h2>\r\n\r\n\r\n\r\n<p>While there are several key differences between object-oriented and functional programming, one is the imperative versus declarative programming model.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>OOP uses the imperative programming model, meaning functions are invariably coded in every step needed to solve a problem. You code each operation with the code itself specifying how to solve the problem. This model requires the programmer to know which functions are necessary to solve a problem instead of relying on models that can solve the problems.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>FP uses the declarative programming model<strong>,<\/strong> meaning it relies on the underlying concepts of a programming language to execute the necessary steps to reach the predetermined outcome.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Imperative programs focus on the step-by-step process of solving a problem, whereas declarative programs focus on the result of solving a problem.<\/p>\r\n\r\n\r\n\r\n<p>Another critical difference is mutability: OOP uses mutable data while FP uses immutable data<strong>.<\/strong> You can alter (or mutate) mutable objects after creation, whereas you can\u2019t for immutable objects. In FP, you\u2019ll need to make a copy of the object and use that copy to write the rest of your code.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Overall, immutable code is easier to update, more efficient to manage, and easier to test and debug. And because variables are constant, the resulting code is easier to understand and reason about. Many programmers and software developers prefer to work with FP models<strong>.\u00a0<\/strong><\/p>\r\n\r\n\r\n\r\n<p>Ultimately, the right programming paradigm for you will depend on your intended application. OOP works best for standardized and straightforward projects, whereas FP works best for projects that require scalability and flexibility.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Learn Functional Programming Languages with Coding Dojo<\/h2>\r\n\r\n\r\n\r\n<p>Now that you understand the merits of learning functional programming, learning the applicable programming languages is the next step.<\/p>\r\n\r\n\r\n\r\n<p>Coding Dojo offers web and software development bootcamps to help you <a href=\"https:\/\/www.codingdojo.com\/web-development-courses\">learn the most in-demand programming languages<\/a>\u2014namely Java, Python, C#.NET, and MERN. You\u2019ll learn full-stack web development, which consists of an application&#8217;s front-end and back-end portions.<\/p>\r\n\r\n\r\n\r\n\r\n\r\n<p><a href=\"https:\/\/www.codingdojo.com\/apply\">Submit your application today<\/a> to launch your new learning and career journey!<\/p>\r\n\r\n\r\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve just started learning how to code, deciding which programming paradigm and programming language to learn first can be tricky.\u00a0\u00a0 If you want to master a programming paradigm relevant to today\u2019s tech landscape, consider going with functional programming. It\u2019s a simplified, cleaner, and more predictable way to create code. Your resulting code is also [&hellip;]<\/p>\n","protected":false},"author":1489,"featured_media":11130,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2],"tags":[],"ppma_author":[2102],"class_list":["post-11482","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-posts"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What Is Functional Programming and Why Use It? - Coding Dojo<\/title>\n<meta name=\"description\" content=\"What is functional programming? Learn about the functional programming paradigm, its core concepts, and main advantages in this complete guide.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What Is Functional Programming and Why Use It? - Coding Dojo\" \/>\n<meta property=\"og:description\" content=\"What is functional programming? Learn about the functional programming paradigm, its core concepts, and main advantages in this complete guide.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming\" \/>\n<meta property=\"og:site_name\" content=\"Coding Dojo\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CodingDojodotco\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-13T14:00:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-31T01:27:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/smiling.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"490\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Brad Mitchell\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodingDojoDotCo\" \/>\n<meta name=\"twitter:site\" content=\"@CodingDojoDotCo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brad Mitchell\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming\"},\"author\":{\"name\":\"Brad Mitchell\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/f0763260736567f77d8107c616816792\"},\"headline\":\"What Is Functional Programming and Why Use It?\",\"datePublished\":\"2022-07-13T14:00:15+00:00\",\"dateModified\":\"2024-10-31T01:27:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming\"},\"wordCount\":1891,\"publisher\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/smiling.jpg\",\"articleSection\":[\"All Posts\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming\",\"url\":\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming\",\"name\":\"What Is Functional Programming and Why Use It? - Coding Dojo\",\"isPartOf\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/smiling.jpg\",\"datePublished\":\"2022-07-13T14:00:15+00:00\",\"dateModified\":\"2024-10-31T01:27:15+00:00\",\"description\":\"What is functional programming? Learn about the functional programming paradigm, its core concepts, and main advantages in this complete guide.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming#primaryimage\",\"url\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/smiling.jpg\",\"contentUrl\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/smiling.jpg\",\"width\":800,\"height\":490,\"caption\":\"Woman laughing while on laptop\"},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#website\",\"url\":\"https:\/\/www.codingdojo.com\/blog\/\",\"name\":\"Coding Dojo\",\"description\":\"Coding Bootcamp News, Career Guidance and More\",\"publisher\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.codingdojo.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#organization\",\"name\":\"Coding Dojo\",\"url\":\"https:\/\/www.codingdojo.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/Dojo-logo.png\",\"contentUrl\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/Dojo-logo.png\",\"width\":287,\"height\":51,\"caption\":\"Coding Dojo\"},\"image\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/CodingDojodotco\",\"https:\/\/x.com\/CodingDojoDotCo\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/f0763260736567f77d8107c616816792\",\"name\":\"Brad Mitchell\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/image\/ec2fbcd1523bbd2627b9829b755f9a82\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dcc8629d03d0958c0b46f7b63ec616978cba85abe345283ecd4ae3dee76e5146?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dcc8629d03d0958c0b46f7b63ec616978cba85abe345283ecd4ae3dee76e5146?s=96&r=g\",\"caption\":\"Brad Mitchell\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What Is Functional Programming and Why Use It? - Coding Dojo","description":"What is functional programming? Learn about the functional programming paradigm, its core concepts, and main advantages in this complete guide.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming","og_locale":"en_US","og_type":"article","og_title":"What Is Functional Programming and Why Use It? - Coding Dojo","og_description":"What is functional programming? Learn about the functional programming paradigm, its core concepts, and main advantages in this complete guide.","og_url":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming","og_site_name":"Coding Dojo","article_publisher":"https:\/\/www.facebook.com\/CodingDojodotco","article_published_time":"2022-07-13T14:00:15+00:00","article_modified_time":"2024-10-31T01:27:15+00:00","og_image":[{"width":800,"height":490,"url":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/smiling.jpg","type":"image\/jpeg"}],"author":"Brad Mitchell","twitter_card":"summary_large_image","twitter_creator":"@CodingDojoDotCo","twitter_site":"@CodingDojoDotCo","twitter_misc":{"Written by":"Brad Mitchell","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming#article","isPartOf":{"@id":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming"},"author":{"name":"Brad Mitchell","@id":"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/f0763260736567f77d8107c616816792"},"headline":"What Is Functional Programming and Why Use It?","datePublished":"2022-07-13T14:00:15+00:00","dateModified":"2024-10-31T01:27:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming"},"wordCount":1891,"publisher":{"@id":"https:\/\/www.codingdojo.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming#primaryimage"},"thumbnailUrl":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/smiling.jpg","articleSection":["All Posts"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming","url":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming","name":"What Is Functional Programming and Why Use It? - Coding Dojo","isPartOf":{"@id":"https:\/\/www.codingdojo.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming#primaryimage"},"image":{"@id":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming#primaryimage"},"thumbnailUrl":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/smiling.jpg","datePublished":"2022-07-13T14:00:15+00:00","dateModified":"2024-10-31T01:27:15+00:00","description":"What is functional programming? Learn about the functional programming paradigm, its core concepts, and main advantages in this complete guide.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codingdojo.com\/blog\/what-is-functional-programming#primaryimage","url":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/smiling.jpg","contentUrl":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/smiling.jpg","width":800,"height":490,"caption":"Woman laughing while on laptop"},{"@type":"WebSite","@id":"https:\/\/www.codingdojo.com\/blog\/#website","url":"https:\/\/www.codingdojo.com\/blog\/","name":"Coding Dojo","description":"Coding Bootcamp News, Career Guidance and More","publisher":{"@id":"https:\/\/www.codingdojo.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codingdojo.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codingdojo.com\/blog\/#organization","name":"Coding Dojo","url":"https:\/\/www.codingdojo.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codingdojo.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/Dojo-logo.png","contentUrl":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/Dojo-logo.png","width":287,"height":51,"caption":"Coding Dojo"},"image":{"@id":"https:\/\/www.codingdojo.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/CodingDojodotco","https:\/\/x.com\/CodingDojoDotCo"]},{"@type":"Person","@id":"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/f0763260736567f77d8107c616816792","name":"Brad Mitchell","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/image\/ec2fbcd1523bbd2627b9829b755f9a82","url":"https:\/\/secure.gravatar.com\/avatar\/dcc8629d03d0958c0b46f7b63ec616978cba85abe345283ecd4ae3dee76e5146?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dcc8629d03d0958c0b46f7b63ec616978cba85abe345283ecd4ae3dee76e5146?s=96&r=g","caption":"Brad Mitchell"}}]}},"authors":[{"term_id":2102,"user_id":0,"is_guest":1,"slug":"bmitchell","display_name":"Brad Mitchell","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/72312b63980f6ac86a1d74e7a54f5de0d489ca9346796f60b8ea6810d65c89af?s=96&r=g","author_category":"","user_url":"","last_name":"Mitchell","first_name":"Brad","job_title":"","description":""}],"_links":{"self":[{"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/posts\/11482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/users\/1489"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/comments?post=11482"}],"version-history":[{"count":2,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/posts\/11482\/revisions"}],"predecessor-version":[{"id":16240,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/posts\/11482\/revisions\/16240"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/media\/11130"}],"wp:attachment":[{"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/media?parent=11482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/categories?post=11482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/tags?post=11482"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=11482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}