| ||Ask HN: How do you explain closures?|
69 points by dstorrs 2634 days ago | hide | past | web | 64 comments | favorite |
|In the past year or two, I've had to explain closures--what they are and why they are interesting--several times. Usually, at the end of my explanation, the person doesn't get it, and they go back to doing whatever they are familiar with.|
So, I ask HN to put yourselves in this scenario and tell me what your answer would be:
Joe is a talented but inexperienced developer. He's got a year or two of experience, maybe as much as 5, but he programs for a job, not for fun. Also, for whatever reason he's never encountered closures--most likely he's only worked in languages that don't really support them.
You want to explain to him (a) what they are and (b) why he would want to use them. You have about 10 seconds to get his interest before he starts thinking about his WoW raid tonight, and about 5 minutes for the whole explanation.
What do you say?
| Apply to YC