2 ms·
If you grok the lambda calculus, this is indeed a simple explanation. In my experience, most people who don't know what functional programming is also don't un
by rauljara 13y ago
If you grok the lambda calculus, this is indeed a simple explanation. In my experience, most people who don't know what functional programming is also don't understand what lambda calculus is. In that case, all you've done is substituted one unknown bit of vocabulary for another.
I've also noticed that when I use unknown vocabulary in my explanations, it sometimes intimidates people away from asking more questions. E.g. "What is <some term I really don't understand>?" "Oh, it's just <another term, that the person you're asking seems to expect you to understand, but you really don't>". So I would avoid the term "lambda calculus" for the uninitiated.
I seem to have pretty good luck explaining what a pure function is (no side effects, same input always produces same output, referential transparency[1]) and going from there.
[1] Which, in turn, requires its own mini-explanation.
- loup-vaillant 13y agoPossibly even more accessible: High school math. In a math exercise, when we state let A = 2 + 3π Then we can be dammed sure that for the rest of the exercise, we can replace "A" by "(2 + 3π)" (and vice-versa) without ever introducing an error. Likewise, functions don't change A's value behind your back no matter what. Something in, something out, period. From there, you can explain function composition, how operators are actually binary functions, even types. We can go really far with just high school math: http://loup-vaillant.fr/tutorials/from-imperative-to-functional http://loup-vaillant.fr/tutorials/from-imperative-to-functio...
- Locke1689 13y agoIf I may, I'd like to log a difference of my intent with the word simple, as opposed to the word easy. Simple is conceptually clean, while easy may be accessible to those familiar with related concepts. My description was, I hope, simple: it has very high fidelity and is not prone to many of the misinterpretations of the other explanations. What it may not be is easy. One may indeed require further explanation to really understand the relationship I'm proposing. Sometimes, though, there is no shortcut to knowledge.