Bookmarklet to Hide Nested Comments

When reading comments on Less Wrong, I sometimes find myself reading reply after reply deep into a discussion when I really shouldn’t be. If I had stopped and thought, I would have said, let’s move on to the next thread. Similarly, I’ve seen comments that pose an interesting question or raise an interesting point get derailed because the first response to that post nitpicks on some issue and reply after reply delve into that. By the time I get to another child of the original comment that addresses its main point, I’ve exhausted myself.

This is nobody’s fault but my own: the nesting mechanism is sound, the default behavior is reasonable, and the show/​hide features are right there, but I don’t find myself using them as much as I should.

As an experiment to see if I can improve my behavior I created this bookmarklet: Hide Nested Comments

EDIT: The link isn’t working right now. It should link to: javascript:var%20cl=$$(‘div.comment’);for(var%20i=0;i<cl.length;i++){a=cl[i];if(a.parentNode.parentNode.id!=‘comments’)hidecomment(a.id.replace(/​​^[^_]*_/​​,″),a)};void(0);

but it doesn’t. Sorry. Presumably I’m in violation of some security policy by attempting to make a bookmarklet in a post. If you trust me, you can create a bookmark with that as the destination yourself, but the directions below about dragging won’t work.

What it does is pretty simple: it hides all comments on a post that aren’t top level comments. This way, the default is that I don’t see all the followups unless I decide that the subject matter is important enough that I want to wade into it. It makes it more effort to dig into subjects that interest me, but (hopefully, at least) I’ll get less distracted where I shouldn’t and a few more clicks won’t kill me.

The biggest drawback I’m aware of right now is that it means that I’ll start missing interesting content that’s buried under uninteresting content (arguably I’m missing most of those anyway). A fancier version might, for example, label the hidden posts with the maximum buried karma.

Anyway, it’s an experiment. Feel free to try it yourself and report back, or tell me why you think it’s a terrible idea.

How do I try it?

One way is to turn on your browser’s bookmark toolbar and drag the above link onto that toolbar. Click on it on the toolbar to use it. If you don’t like the results, just refresh. Another way, in Firefox, is to right-click (control-click on Mac) on the link and choose bookmark this link.

What’s the code?

The javascript that makes the bookmarklet work is:

var cl=$$(‘div.comment’); //​ a list of all the comment divs on the page
for (var i=0; i<cl.length; i++) {
a=cl[i]; //​ take each in turn (forgot “var”, sigh)
if (a.parentNode.parentNode.id!=‘comments’) hidecomment(a.id.replace(/​^[^_]*_/​,″),a); //​ unless it’s top-level, hide it
};
void(0);
//​ (yeah, I could use .each(...), but I didn’t; it’s just a hack at the moment anyway)