I've programmed a bit of Haskell and Prolog as part of a couple of uni courses, but that's about it. And I've never seen it been used in industry (not that I've had much of working experience to begin with but I've never seen an ad where you are required to know them).

So should we be using functional and/or logic programming languages more often? Are there any advantages or disadvantages for using or not using them?

3 Answers 3


I believe in using the right tool for the job. Both imperative and functional languages have their place and there's no need to push for using one kind more than the other.

For the advantages/disadvantages, I don't think I could beat Eric Lippert's answer to the "Why hasn't functional programming taken over yet?" SO question.

  • Hmm? Why the downvote?
    – Adam Lear
    Commented Sep 16, 2010 at 15:42
  • 1
    I haven't downvote but I disagree with his answer (such as 'mistaking' concurrency and parallelizm - in functional world those terms means 2 different things). However it does not mean I think it is bad answer. Commented Sep 16, 2010 at 18:28
  • Indeed, Eric Lippert's was a very informative answer. Thanks for the direction.
    – gablin
    Commented Sep 16, 2010 at 22:12

First of all - because the compiler has to do much more. If you want to create an imperative compiler, you can nearly do 1-1 transformation to assembler and the code produced will have acceptable speed (sure, there could be much to do, but it is 'basically' 1-1 compilation + optimisation). Functional compilers HAVE TO handle well heavy inlining, tail-call optimisation, etc. Therefore, implementation of functional languages were much slower than C/C++/... in the past (however, they gain much speed each iteration as compilers are getting better).

Secondly - programmers are so used to state that they cannot 'accept' "there is no spoo... state" approach. Sure, the lack of state is not useful in each condition, but the lack of (global) state does not mean lack of local state.

Thirdly - functional programming has no nice story behind it. The OOP has nice story as the objects map to nouns and how intuitive it is. Afterwards, you know that it is not so simple because you cannot create a class Manager as subclass of Employee as Employee may get promoted to Manager and you have to play around decorators. The functional programs have story in mathematics which is IMHO more useful but less marketable.

As internally from the computer perspective - there is no difference between parallel and concurrent computing. Many programmers do not see a difference and many languages have the same primitives to handle both. Thanks to lack of local state and lightweight threads in functional programming languages, the parallelisation of algorithm is much easier. However, concurrent programming is not made automatically easier as concurrency is about global state.

Finally - there is a lot of older programs written in imperative style. Even porting from imperative language to imperative language is much simpler than to functional ones.

As far as I know, investment banks start embracing the functional programs internally so they DO come into XXI c. (in very important although hidden area) - so they do gain momentum.

PS. While I believe that functional programs are "better" in meaning, they hide the complexity better than other approaches, it does not mean that there are no areas such as scripts that are inherently imperative.


A programming language is a form of representation of information, in this case, instructions for the computer to follow. However, the representation is also important for the target audience (i.e. the programmers).

Functional/logical concepts are not as commonly used in daily life as procedural concepts. If you read instructions (e.g. how to use your television, DVD player, or build some furniture from IKEA), they are mostly written in a procedural way (albeit in natural language).

Therefore, a lot of people that are not very deeply involved in math or sciences often are far more familiar with such procedural concepts than the logical or functional ones.

I think this has a lot of impact on the choice of which class of programming language is used. In the end, the set of problems that can be solved with any of such programming languages are pretty much the same (as long as they are all Turing complete).

However, a lot of procedural languages are obtaining more and more facets of other concepts. Python can do lambda-calculus and closures, Ruby as well. JavaScript, which is heavily used in the industry, is actually really a functional language (most people even "misuse" it by using it more in a procedural way). Therefore, it is really the task of the programmer to use those features appropriately where they fit.

  • 2
    Since when is JavaScript a functional language?
    – Jonas
    Commented Sep 16, 2010 at 15:26
  • 1
    @Jonas - It is indeed a functional language and it always has been. Of course a language can follow many paradigms at once as JavaScript does. Commented Sep 16, 2010 at 16:17
  • 2
    @ChaosPandion: Just because it has closures and high order functions? :)
    – Jonas
    Commented Sep 16, 2010 at 16:38
  • @Jonas - Indeed, obviously we are not talking Haskell here but you can still call it functional. Commented Sep 16, 2010 at 17:06
  • 4
    I guess that you should consider general approach to problem in idiomatic way. Hence if programming langauge suggest to split problem into pure functions it is functional. If it suggest to split problem into objects it is object-oriented. If it suggest to "do this and then do that" it is imperative. Hence lambdas, continuations etc. are not necessary features only for functional languages and JS is not a functional language as it does not 'suggest' to think in terms of functions and immutable data. Commented Sep 16, 2010 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.