Hacker News new | past | comments | ask | show | jobs | submit login

> Non-functional programs read like plain English.

It depends partly on what you're used to. You're used to programs specifying instructions (since that's what we think of as an algorithm), so yes, Lisp won't look like "plain English" instructions.

However, functional programs don't define instructions - just relationships. For the most part, they wash their hands off of specifying the details of the execution, in favor of looking only at the high-level, mathematical relationships.

In that sense, Lisp programs like

(define x (map (lambda (x) (* 2 x)) (sort '(2 3 2 1 4))))

is defining a relationship between x and the list '(2 3 2 1 4), the same way that

x = 2y + 3

is defining a relationship between x and y. The latter doesn't tell you how to get the value of x (for a given y value), but defining that relationship is sufficient to understand the concepts.

So, you could say that non-functional programs read like plain English instructions of actions, whereas functional programs read like plain English mathematical relationships.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: