5 ms·
It's called a continuation. Continuations are essentially closures being passed around to represent state (hence "fnid"), check the Wikipedia page on them for a
by DrJokepu 15y ago
It's called a continuation. Continuations are essentially closures being passed around to represent state (hence "fnid"), check the Wikipedia page on them for a proper, computer sciencey definition. The nature of Lisp really lends itself to continuation-based programming. Sometimes (like on HN) it's used in web applications. In the context of web applications, it's a different approach than, for example, REST/MVC. It has a few nice properties, such as easy state management. This can be very useful when a web application is an interface to a process (e.g. checkout in a web store) as opposed to CRUDA. On HN, it allows paging that "remembers" the order of things at the time you visited the first page. Reddit uses a similar mechanism. The obvious downside is that you have to keep track of all those states and if you lose them (for example because they expire), the user workflow is interrupted (hence the error message).
It's not the trendiest programming technique around these days but it's a useful tool in the toolkit of a good developer.
- a_a_r_o_n 15y ago"The nature of Lisp really lends itself to continuation-based programming." This comes up occasionally on HN. I've never seen anyone say anything positive about it. It seems like a software detail that's unnecessary exposed to users. It doesn't make the site better, it makes it worse.
- funkah 15y agoI completely agree, but I wouldn't mind it nearly so much if the "expired link" page at the very least had a link to the home page.
- a_a_r_o_n 15y agoOr to the next page.
- pjob 15y agoI added a suggestion to that effect on the Feature Request thread (http://news.ycombinator.com/item?id=363 http://news.ycombinator.com/item?id=363) a while ago, but it slipped off into the long tail of comments pretty quickly: http://news.ycombinator.com/item?id=1480352 http://news.ycombinator.com/item?id=1480352
- MrTortoise2 15y agoI disagree, as i look at HN several times a day i like how pages expire. It explicitly tells me that the order has changed. People are WAY too fussy about messages in their UX because we have abstracted UX to such an extent that we expect the same smooth UE independently of function. The internets expectations (and sheepishness) is making all software like that crap you get free with your camera.
- recursive 15y agoReddit does not use a similar mechanism. Here's an example of one of their next page links: http://www.reddit.com/?count=100&after=t3_q1sxk http://www.reddit.com/?count=100&after=t3_q1sxk The count is the number of stories to skip, the after is the id of the last story on the previous page.
- tensor 15y agoI don't see how that improves anything. If you click that link, you still see "nothing here".
- notJim 15y agoThe point isn't that it's an improvement, the point is that it's completely different. It's the "standard" way of doing pagination (limit + offset), not a continuation.
- bri3d 15y agoThat's not offset + limit; it's start ID + count, which is functionally very different from offset + limit. If Reddit were to use offset + limit, one would frequently visit page 2 only to see the same articles they were reading on page 1 five minutes before. A good example of this issue with offset + limit based pagination is 4chan, which is basically impossible to read in a linear or sane manner. Reddit somewhat alleviates the problem by ensuring that posts after the last one you read are displayed - you'll occasionally see some of the same posts you were reading on page one, and occasionally miss posts that "jump" to page one while you're reading it, but it'll at least be usable, unlike 4chan.
- notJim 15y agoYes, you are correct, I was merely being lazy in my description.
- recursive 15y agoI'm not claiming it's an improvement.
- sj26 15y agoThis reminds me waaaay too much of ASP.NET's oh-so-wonderful __VIEWSTATE.