Functional: Programming For Dummies

If you want to write code like a functional programmer, you need to follow these basic rules:

: A function is "pure" if it always gives the same output for the same input and has no side effects (it doesn't change anything outside itself, like updating a database). Functional Programming For Dummies

: 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. If you want to write code like a

: You focus on the logic of what needs to be solved rather than the specific control flow (like for or while loops). Why Bother Learning It? Functional Programming For Dummies