2 ms·
Basically funtional programming helps resolve the problem of bugs. If you rarely make bugs in your code, you probably wont get any advantage from functional lan
by olavk 18y ago
Basically funtional programming helps resolve the problem of bugs. If you rarely make bugs in your code, you probably wont get any advantage from functional languages. They don't allow you to do anything practical which is not possible in OO or imperative languages (and vice versa).
So, how does functional programming reduce bugs? The theory is that we make bugs because programs are too complex to grasp fully (even if we wrote the whole progam ourselves), which makes us make wrong assumptions about what happens in a given piece of code, and how that piece of code will influence other parts of the program.
Functional programming tries to reduce the amount of different "invisible" outside factors which may determine what will happen in a given piece of code. This makes it easier to understand code and avoid mistakes.