This is a functional Programming
Book afree demoto know more
Functional Programming (FP) is a programming paradigm that treats computation as the evaluation of mathematical functions. Instead of changing data step by step, FP focuses on what to compute, not how to compute it.
At its core, functional programming emphasizes pure functions—functions that always produce the same output for the same input and do not cause side effects. This makes code easier to understand, test, and debug. Another key idea is immutability, meaning data is not modified after it is created; instead, new data is returned. This reduces unexpected bugs caused by shared state.
FP also promotes concepts like higher-order functions (functions that take other functions as arguments or return them), function composition, and declarative code. These ideas lead to concise, expressive, and reusable programs.
Languages such as Haskell, Scala, Elixir, and Clojure are strongly functional, while modern languages like JavaScript, Python, and Java support functional features as well.
In today’s world of concurrent and distributed systems, functional programming shines by making code safer, more predictable, and easier to scale—helping developers build robust and maintainable software.
Copyright © Brain-mentors 2015