leanmind logo leanmind text logo

Blog

Advanced TDD

The tools you need to apply TDD in the real world on any project.

Functional Operators

By Adrián Ferrera González

Array Refactoring Patterns

You may have probably heard of functional programming many times, however, if you are starting in the world of development or you come from object oriented programming, you will not know with certainty what it is about.

Let’s begging with a basic definition, since the aim of this term is creating a functionality based on programming methods, it receives a few entries params, in order to return a value, at this stage it doesn’t exist side effects, it means that values are immutable. Functions that fulfil these requirements are called pure functions.

At programming languages as Javascript, exists functions at the language, that make some operations: map, find, filter, reduce, forEach, etc, this operations are called functional operators and have been created to work over list of values (arrays).

Are necessaries?

Of course not. The fact that they exist does not mean that these operators will be the solution to resolve every programmatic problem. However, they are a tool that will protect you from several errors as mutability of values, hoisting errors or just to improve the readability when you have enough experience.

When making TDD, it is not a good option to focus our code on a functional operators since it will close our code design to this solution, conversely, in a mature version of the code or when we some patterns match, is a good point to apply this solution and couple to our code.

Read more…


Source: https://adrianferrera.dev/blog/functional-operators
Published on 2021/01/04 by
Adrián image

Adrián Ferrera González

https://adrianferrera.dev

Do you want more? We invite you to subscribe to our newsletter to get the most relevan articles.

If you enjoy reading our blog, could you imagine how much fun it would be to work with us? let's do it!

We boost the professional growth of your development team