3 ms·
This is one good reason to learn functional programming. Functional programming is all about algorithms and the algorithms are generally laid bare to be easily
by sambeau 15y ago
This is one good reason to learn functional programming. Functional programming is all about algorithms and the algorithms are generally laid bare to be easily seen (rather than hidden in the noise of syntax). I have found that being taught functionally programming gave me a firm footing in reasoning about algorithms.
For instance: I can write a sort in any language because I carry this little gem around in my head:
quicksort [] = []
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
where
lesser = filter (< p) xs
greater = filter (>= p) xs
Bird & Wadler is a great introduction to functional programming as well as algorithms and efficient data structures.
http://www.amazon.com/Introduction-Functional-Programming-International-Computing/dp/0134841891 http://www.amazon.com/Introduction-Functional-Programming-In...
(blimey, I had no idea my old copy was now so valuable!)