• Introduction to Functional Programming

    The first programming paradigm that most programmers in the 21st century learn is probably Object Oriented Programming (or OOP for short). Object Oriented Programming allows us to transform real-world entities into highly abstract models with descriptive properties and executable methods to simulate their behaviors in the real world. Despite its numerous advantages, such as readability, reusability, and maintainability, it also introduces immense complexity to state management. The difficulty in keeping track of the states of objects has led head-scratching exhausted programmers to churn out error-prone code and cause bugs that would take hours, or even days, to locate and fix. “Is there a way out of this undesirable situation,” you might ask. Here is the good news: a lesser-known yet widely-used programming paradigm called Functional Programming (or FP for short) can help turn the tide around and decrease the number of bugs we cause. In this article, I will explain what Functional Programming is and why it can help us avoid bugs.

    ...