What is the deal with functional programming? I see talk about it a lot but to be honest I've never found them at all useful. Why do so many universities apparently teach them?
|
Start with Why Functional Programming Matters. Then move to Why Why Function Programming Matters Matters. A few bullets:
|
|||||||||||||||
|
Functional Programming concepts build a foundation that will change the way you think and help you solve real world problems. The concept is similar to why we all learn Multi-Variable Calculus, Algebra, and/or Engineering Physics as Computer Science majors, even though we may not ever need that specific knowledge in our careers. This is why Law Schools love candidates with a B.S in Mathematics. Studying Mathematics teaches you to think about multiple concepts in a logical manner, and functional programming teaches you abstractions and many other important concepts that help you break down problems and look at them in a different light. In summary, functional programming helps teach you how to learn. |
|||
|
When your beginning, functional programming is the best thinking modal. Because most of your programs will not require object-orientation. At least that's been my experience. However, now that I get into some apps, that require separation of display and logic, that's when I started to separate all the logic and display code, to make it easier for each do what it's best at. But you won't know why to do that, unless you master functional first. I never liked people shoving down oo to me, that oo is solution for everything, just make sure whatever approach you use, makes sense for what you are working on, and isn't too steep a learning curve to take too much time away from the work you get paid to do. |
|||||
|
While I personally find pure functional languages too restrictive for entire programs, you might be surprised how often portions of a program in a more traditional language work well using functional programming concepts. For example, using pure functions can make them easier to unit test and easier to make thread safe. The concepts are well worth knowing about. |
|||
|
Maybe because universities want to teach something from all programming paradigms, and for certain things functional programming is better (like describing game characters movement and describing animations) |
|||
|
Because in general it uses less code to accomplish the same task. Less code to write, is less code to maintain. Besides being less code, it is also tends to have less state, and thus it is a little simpler to reason about (once you're used to it). |
|||
|