Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

(I'll take a crack at explaining this momentarily...)

Good grief, that took a long time. Here you go: http://pastebin.com/bSW5dfRQ [1]. I'd better stop neglecting my duties now!

Edit: One thing I forgot to put in there: one reason the closure technique is powerful is that you're leveraging the programming language and runtime to do most of the book-keeping for you. Whatever data is handy, you just reference. The system will remember all the references. That's why using things like query strings and hidden form fields is more complicated: you have to handle all those details yourself (not to mention serialize and deserialize them if you're passing through any other format than what your program keeps in memory). That is tedious, and when your app has many kinds of request, the complexity quickly piles up.

Of course there are other abstractions you can build over this, but closures are an elegant one—especially in cases where programming simplicity is more important than scalability, which is most cases.

Edit 2: A few people thought this should be its own post, so I made https://news.ycombinator.com/item?id=8425011.

[1] Originally http://pastebin.com/dETyYtpX, but I added the above bit etc.



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

Search: