If you want to write code like a functional programmer, you need to follow these basic rules:
: Once you create a piece of data, you never change it. If you need a modified version, you create a whole new copy with the changes. Functional Programming For Dummies
Functional programming (FP) is a style of coding where you treat software as a series of mathematical functions rather than a list of instructions. Instead of telling the computer to do something step-by-step, you describe what you want to happen. The Core Pillars of Functional Programming If you want to write code like a