The biggest advantage I've noticed so far is that once it works it just keeps on working, it is almost like it is hard to create bugs in functional code than it is in imperative code.
This must have something to do with the lack of side effects.
For some fun I coded up a small site in PHP in a functional style (I can see a lot of HN'ers gouge out their eyeballs at this sentence, apologies, it was just an experiment), and it gave me a lot more practice in reading functional code.
But the side effect free trick had - pun intended - a side effect by itself, the code worked the first time out after writing it, and that's unusual for a 1500 lines or so project, once the minor syntactical problems were dealt with (mostly quoting issues).
That really was unexpected, if there is any concrete explanation for that (other than blind luck) I'd like to hear it, and if this is more common in the 'functional world'.
This must have something to do with the lack of side effects.
For some fun I coded up a small site in PHP in a functional style (I can see a lot of HN'ers gouge out their eyeballs at this sentence, apologies, it was just an experiment), and it gave me a lot more practice in reading functional code.
But the side effect free trick had - pun intended - a side effect by itself, the code worked the first time out after writing it, and that's unusual for a 1500 lines or so project, once the minor syntactical problems were dealt with (mostly quoting issues).
That really was unexpected, if there is any concrete explanation for that (other than blind luck) I'd like to hear it, and if this is more common in the 'functional world'.