functional

Justin Johansson no at spam.com
Wed Mar 10 13:51:01 PST 2010


James Iry Wrote:

> No, C does not support functional programming.  It is pretty much impossible to write an interesting C program that does not mutate things.  That's not a condemnation of C, I still have a soft spot in my heart for it, but it is a recognition of how C is deeply tied to an imperative model of computation.

Impossible?  Tedious perhaps but certainly not (even close to) impossible.

Thinking of C++ as syntactic sugar over C, and given that most of my C++ development work
these days is functional in nature (emphasising the immutability aspect), I contest that your
statement is false as a blanket, outright statement.  Certainly though, to code C/C++ in a 
functional fashion requires a fair amount of experience and rethinking of imperative coding habits.

There is no reason to think that D programming cannot also be approached with a functional mindset.

Justin Johansson






More information about the Digitalmars-d mailing list