Functional Programming and Blockchain

some initial words

As a software developer when I started to enter the blockchain world I notice something strange, the world was divided into two, from one side it was the Functional Programming Paradigm, and from the other side the Object-Oriented paradigm so the purpose of this article is to explain with common words why functional programming is useful in the new blockchain technology, it is not a technical document, but you need to know something about programming.

a bit of story

The world of programming is driven by the Object-Oriented Paradigm (POO) because it is easy to use, and maintain, so the natural way is to use it on the blockchain as the main programming language, that is because most of the programmers know POO then when they start to work, they think that this paradigm is the ultimate paradigm for all, and it was for a long time, then the blockchain technology appears on the stage and programmers keep working on the POO paradigm, and then the problems started.

As a web developer when you have a problem in the code, you only need to redeploy your or release a patch code then the problem will be fixed, that is the way to work in software development.

but in blockchain this is not possible, you can not redeploy your code easily, imagine a distributed system with your code replicated in a lot of nodes, it is not easy to fix a bug as in the normal software deployment, so, in this part is when functional programming paradigm becomes popular.

why use functional programing

Functional programming has two main things, it is not executed step by step as a normal program such as C or C++, so it fits better in distributed systems because it doesn't need to sync the running process, and second, it is hard to introduce a logic bug inside, at this point you should understand that programmers are humans, and humans made mistakes, so we must reduce it as much as possible in blockchain technology because a mistake is a lot harmful than in another system, you can lose millions of dollars if you made a mistake in the blockchain technology. There are a lot of real-world samples there that you can check.

Conclusion

Functional programming is not new, but it is very unpopular yet but is gaining momentum in the blockchain world because is nature, this paradigm fits better in this ecosystem than POO, so if you are interested in the crypto world, you should start to learn it