teacher at FreeCodeCamp.com · Upvoted by , Ph.D. Computer Science, University of Lorraine (2011) and , Ph.D. Computer Science & Human-Computer Interaction, Northeastern University (2020) · Author has 355 answers and 30.7M answer views · Updated 8y ·
Functional Programming.
This programming paradigm, most famously used in Microsoft Excel, is taking software development by storm.
(source: Don't Be Scared Of Functional Programming – Smashing Magazine)
The basic ideas behind Functional Programming are that:
- Data should be immutable. Instead of manipulating data, you should make a new copy of it.
- Programs should be stateless. No function should care about what has happened in the past.
Why should you bother with Functional Programming?
(source: xkcd: Functional)
In all seriousness, here are some of the reasons our open source project uses Functional Programming.
- It allows for parallelism and concurrency on a massive scale. This is why some of the highest performance languages are functional.
- By using abstractions to handle tasks like iteration, you reduce the amount of code you have to maintain, and thus the number of things that can go wrong.
- You shift the work from a bunch of small specific functions to a few higher order functions (functions that take other functions as inputs or output a function). This allows you to focus more on results than specific steps.
- With no stored state and only derived data, you can scale horizontally (with more cheap computers) rather than up (with more powerful computers). This makes it easier to spin up servers when traffic rises and power them down when traffic falls.
- JavaScript, the most popular language (and the language we teach), is well suited to the Functional Programming paradigm.
Functional programming is a fad, but it's not a new one. And this time it may very well stick around and become a mainstay.
I only write about programming and technology. If you follow me I won’t waste your time.
449.4K views ·
View upvotes
· View 1 share
· 1 of 34 answers
Something went wrong. Wait a moment and try again.