Functional programming is a programming paradigm which makes it easy to create, reason about, and compose functions.
70
votes
13answers
34k views
What is the advantage of currying?
I just learned about currying, and while I think I understand the concept, I'm not seeing any big advantage in using it.
As a trivial example I use a function that adds two values (written in ML). ...
51
votes
5answers
4k views
How do you design programs in Haskell or other functional programming languages?
I have some experience in object oriented programming languages like c# or ruby. I know how to design a program in object oriented style, how to create classes and objects, and how to define relations ...
51
votes
4answers
4k views
Functional Programming vs. OOP
I've heard a lot of talk about using functional languages such as Haskell as of late. What are some of the big differences, pros and cons of functional programming vs. object-oriented programming?
41
votes
12answers
4k views
Why isn't functional programming more popular in the industry? Does it catch on now? [closed]
During my four years at university we have been using much functional programming in several functional programming languages. But I have also used much object oriented programming to, and in fact I ...
39
votes
14answers
2k views
Why the current enthusiasm for Functional Programming? [closed]
I've been hearing a lot of enthusiasm about functional programming languages lately, with regards to Scala, Clojure, and F#. I've recently started studying Haskell, to learn the FP paradigm.
I love ...
37
votes
5answers
2k views
In functional programming, does having most of the data structures immutable require more memory usage?
In functional programming since almost all data structure are immutable, when the state has to change a new structure is created. Does this mean a lot more memory usage? I know the object oriented ...
36
votes
4answers
2k views
What are the biggest differences between F# and Scala?
F# and Scala are both functional programming langugages that don't force the developer to only use immutable datatypes. They both have support for objects, can use libraries written in other languages ...
35
votes
12answers
3k views
What programming language generates fewest hard-to-find bugs? [closed]
What language, in your opinion, allows the average programmer to output features with the least amount of hard-to-find bugs? This is of course, a very broad question, and I'm interested in very broad ...
34
votes
7answers
3k views
Functional Programming on the rise?
I have noticed lately that functional programming languages are gaining popularity. I recently noticed how the Tiobe Index shows an increase in their popularity in comparison to the last year although ...
34
votes
5answers
2k views
Critique of the IO monad being viewed as a state monad operating on the world
The IO monad in Haskell is often explained as a state monad where the state is the world. So a value of type IO a monad is viewed as something like worldState -> (a, worldState).
Some time ago I ...
32
votes
5answers
2k views
what is the purpose of arrows?
I am learning functionnal programming with Haskell, and I try to grab concepts by first understanding why do I need them.
I would like to know the goal of arrows in functional programming languages. ...
31
votes
9answers
3k views
Good videos and podcasts on Functional Programming? [closed]
Can you recommend some good downloadable podcasts and videos on Functional Programming languages. Pure and non pure: Scala, Haskell, ML, Miranda, Scheme, Lisp, Erlang, Clojure, Jaskell, Functional ...
30
votes
18answers
5k views
What would you do if your client required you not to use object-oriented programming?
I am writing a program to simulate the activity of ants in a grid (PDF). The ant can move around, pick up things and drop things.
The problem is while the action of the ants and the positions of each ...
29
votes
2answers
5k views
Can somebody explain me what are lambda things in programming?
So far I heard about :
Lambda calculus
Lambda programming
Lambda expressions
Lambda functions
Which all seems to be related to functional programming...
Apparently it will be integrated into ...
27
votes
7answers
4k views
Is Functional Programming possible in Java?
I was browsing through the Amazon.com Bookstore and I came across the book "Functional Programming for Java Developers".
I know some very basic Functional Programming and have been programming in ...
27
votes
2answers
947 views
What did Alan Kay mean by “assignment” in The Early History of Smalltalk?
I have been reading The Early History of Smalltalk and there are a few mentions of "assignment" which make me question my understanding of its meaning:
Though OOP came from many motivations, two ...
26
votes
12answers
2k views
Is Haskell's type system an obstacle to understanding functional programming?
I'm studying Haskell for the purpose of understanding functional programming, with the expectation that I'll apply the insight that I gain in other languages (Groovy, Python, JavaScript mainly.)
I ...
26
votes
10answers
2k views
Why are side-effects considered evil in functional programming?
I feel that side effects are a natural phenomenon. But it is something like taboo in functional languages. What are the reasons?
Edit: My question is specific to functional programming style. Not all ...
26
votes
9answers
3k views
What decent web-frameworks exists for functional programming? [closed]
I would like to do some web programming using functional programming. What decent web-frameworks exists for functional programming languages?
26
votes
2answers
996 views
Misconceptions about purely functional languages?
I often encounter the following statements / arguments:
Pure functional programming languages do not allow side effects (and are therefore of little use in practice because any useful program does ...
25
votes
7answers
1k views
Should one comment differently in functional languages?
I'm just getting started with functional programming and I'm wondering about the correct way to comment my code.
It seems a little redundant to comment a short function as the names and signature ...
25
votes
7answers
1k views
Why Functional Programming
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?
23
votes
6answers
7k views
Haskell AND Lisp vs. Haskell OR Lisp
I currently code with C, C++, and Python. I'm wanting to pick up a functional programming language, and right now I'm leaning toward Haskell. I do NOT want to start a "Haskell vs Lisp" war here; what ...
23
votes
7answers
2k views
Are small amounts of functional programming understandable by non-FP people?
Case: I'm working at a company, writing an application in Python that is handling a lot of data in arrays. I'm the only developer of this program at the moment, but it will probably be ...
23
votes
5answers
2k views
What is the difference between a function and a lambda?
I'm a little bit confused about 'function' and 'lambda'. I've seen some examples showing that the scheme keyword lambda works very similarly to the JavaScript keyword function, but I really don't ...
23
votes
2answers
1k views
Why did the Haskell committee choose monads to represent IO?
The Clean language uses uniqueness types to handle IO in a purely functional setting. Why did the Haskell committee go with monads instead? Were there other proposals for handling state that the ...
21
votes
1answer
446 views
Performance of single-assignment ADT oriented code on modern CPUs
Working in immutable data with single assignments has the obvious effect of requiring more memory, one would presume, because you're constantly creating new values (though compilers under the covers ...
20
votes
11answers
5k views
Scheme vs Haskell for an Introduction to Functional Programming?
I am comfortable with programming in C and C#, and will explore C++ in the future. I may be interested in exploring functional programming as a different programming paradigm. I am doing this for fun, ...
20
votes
6answers
1k views
Functional programming compared to OOP with classes
I have been interested in some of the concepts of functional programming lately. I have used OOP for some time now. I can see how I would build a fairly complex app in OOP. Each object would know how ...
19
votes
6answers
2k views
Does learning a functional language make a better OOP programmer?
As a Java/C#/C++ programmer I hear a lot of talk about functional languages, but have never found a need to learn one. I've also heard that the higher level of thinking introduced in functional ...
19
votes
6answers
2k views
Is functional programming a superset of object oriented?
The more functional programming I do, the more I feel like it adds an extra layer of abstraction that seems like how an onion's layer is- all encompassing of the previous layers.
I don't know if this ...
19
votes
6answers
2k views
Choosing a functional programming language
I have read a lot of threads about functional programming languages lately (almost in the past year, in fact). I would really like to pick one and learn it thoroughly.
Last [course] semester, I have ...
19
votes
10answers
1k views
How would Functional Programming proponents answer this statement in Code Complete?
On page 839 of the second edition, Steve McConnell is discussing all the ways that programmers can "conquer complexity" in big programs. His tips culminate with this statement:
"Object-oriented ...
18
votes
11answers
2k views
If we can do functional programming with Python, do we need a specific functional programming language? [closed]
Using generators and lambda, we can do functional programming with Python. You can also achieve the same thing with Ruby.
So the question is: why do we need specific functional programming languages ...
18
votes
4answers
957 views
Why do some functional languages need software transactional memory?
Functional languages, by definition, should not maintain state variables. Why, then, do Haskell, Clojure, and others provide software transactional memory (STM) implementations? Is there a conflict ...
18
votes
1answer
799 views
How to organize functional programs [duplicate]
Possible Duplicate:
Functional Programming vs. OOP
How to write manageable code with functional programming?
In OOP, your basic unit of organization for code is the class. A frequently ...
18
votes
3answers
948 views
Do all functional languages use garbage collection?
Is there a functional language which allows to use stack semantics - automatic deterministic destruction at the end of the scope?
17
votes
15answers
3k views
What's your strongest opinion against functional programming? [closed]
Functional programming is one of the oldest programming paradigms. However it isn't used much in the industry compared to more popular paradigms. But it have largely been emphasized in academia.
...
17
votes
6answers
1k views
how a pure functional programming language manage without assignment statements?
When reading the famous SICP, I found the authors seem rather reluctant to introduce the assignment statement to Scheme in Chapter 3. I read the text and kind of understand why they feel so.
As ...
17
votes
3answers
5k views
Haskell vs Erlang for web services
I am looking to start an experimental project using a functional language
and am trying to decide beween Erlang and Haskell, and both have some points
that I really like.
I like Haskell's strong ...
17
votes
2answers
458 views
What are the typical applications of Lisp macros?
I am trying to learn some LISP and I have read a lot about the importance of LISP macros so I would like to get some working experience with them.
Can you suggest a practical application area that ...
17
votes
3answers
454 views
Are there any empirical studies on the effect of different languages on software quality?
The proponents of functional programming languages assert that functional programming makes it easier to reason about code. Those in favor of statically typed languages say that their compilers catch ...
16
votes
5answers
2k views
Is objected oriented programming paradigm outdated since it is anti-modular and anti-parallel?
I have read the controversial article Teaching FP to freshmen posted by Robert Harper who is a professor in CMU. He claimed that CMU would no longer teach object oriented programming in the ...
16
votes
5answers
2k views
For what common problems is functional programming not a good fit?
Functional programming is a declarative paradigm. One of the strenghts with FP is that side-effects are avoided. It's said that for some problems FP isn't a good fit.
For what common problems isn't ...
16
votes
2answers
513 views
Different ways to see a monad
While learning Haskell I have faced a lot of tutorials trying to explain what are monads and why monads are important in Haskell. Each of them used analogies so it would be easier to catch the ...
15
votes
10answers
2k views
How to write useful Java programs without using mutable variables
I was reading an article about functional programming where the writer states
(take 25 (squares-of (integers)))
Notice that it has no variables. Indeed, it has nothing more than three ...
15
votes
7answers
701 views
Accessible book on functional programming [closed]
I'm looking for a book that explains functional programming in an accessible manner. Also I would prefer one that isn't too dull, and doesn't use an esoteric language.
Ideally it will use examples ...
15
votes
2answers
884 views
Is return-type-(only)-polymorphism in Haskell a good thing?
One thing that I've never quite come to terms with in Haskell is how you can have polymorphic constants and functions whose return type cannot be determined by their input type, like
class Foo a ...
15
votes
3answers
1k views
What is the origin and meaning of the phrase “Lambda the ultimate?”
I've been messing around with functional programming languages for a few years, and I keep encountering this phrase. For example, it is a chapter of "The Little Schemer, which certainly predates the ...
15
votes
5answers
2k views
Where are all the functional programming design patterns?
OO programming literature is full of design patterns. Most books on object oriented programming dedicate a chapter or two to design patterns like factories and decorators. So what are the equivalent ...
