According to an analysis, a developer creates 70 bugs per 1000 lines of code on average. As a result, he spends 75% of his time on debugging. So sad!
Bugs are born in many ways. Creating side effects is one of them.
Some people say side effects are evil, some say they’re not.
I’m in the first group. Side effects should be considered evil. And we should aim for side effects free code.
Here are 4ways you can use to achieve the goal.
Just add use strict; to the beginning of your files. This special string will turn your code validation on and prevent you from using variables without declaring them first.
Who else loves to write side-effects-free functions? I think we, as programmers, all do. Today, in this story, I will walk you through the basic principles of functional programming that will make your coding life easier.