Contents
What are the problems of functional programming?
Five Drawbacks/Downsides of Functional Programming
- Input/output (IO) IO relies on side effects, so it’s inherently non-functional.
- Recursion.
- Terminology problems.
- The non-functionality of computers.
- The difficulty of stateful programming.
- Abstraction is powerful.
- It’s inherently parallel.
- It’s easily testable/debuggable.
What is cons in functional programming?
In computer programming, cons (/ˈkɒnz/ or /ˈkɒns/) is a fundamental function in most dialects of the Lisp programming language. cons constructs memory objects which hold two values or pointers to values. The word “cons” and expressions like “to cons onto” are also part of a more general functional programming jargon.
Is functional programming slow?
Functional languages will seem slower because you’ll only ever see benchmarks comparing code that is easy enough to write well in C and you’ll never see benchmarks comparing meatier tasks where functional languages start to excel.
What are the pros and cons of functional programming vs Object Oriented programming?
Let’s dive in!
- OOP Pros: — Objects and methods are very readable and understandable.
- OOP Cons: — OOP commonly depends upon shareable state.
- FP Pros: — Utilizing pure functions, leads to reliable functions with no side effects that accomplish and return exactly what you expect them to.
- FP Cons:
- Sources:
What are some of the disadvantages of functional programming?
The advanced math terminology (monad, monoid, functor, etc.) makes FP intimidating. For many people, recursion doesn’t feel natural. Because you can’t mutate existing data, you instead use a pattern that I call, “Update as you copy.” Pure functions and I/O don’t really mix.
Is there such thing as pure function in functional programming?
Terms like “pure functions” and “referential transparency” can sound like Greek to those who are new to functional programming, or even to functional veterans who haven’t learned all of the terms. This might sound trivial, but I don’t think the problem should be understated.
What are the disadvantages of writing pure functions?
Writing pure functions is easy, but combining them into a complete application is where things get hard. The advanced math terminology (monad, monoid, functor, etc.) makes FP intimidating. For many people, recursion doesn’t feel natural.
Why are computers not built in a functional way?
This doesn’t mean that computers don’t work, but that computers don’t operate in a functional way. They’re built on stateful, imperative operations. When it gets down to the metal, they are just large state machines, so the idea of a pure functional language all the way down to metal doesn’t make sense.