

Ask PG: Displaying number of comments on HN posts - _gbc

PG, could you please explain how HN decides when to show&#x2F;hide the total number of comments on a post?<p>When there are 0 comments on a story, the link is shown as &quot;discuss&quot;. The link changes to &quot;1 comment&quot; or &quot;N comments&quot; for N&gt;1. However, at some point, it changes just to &quot;comments&quot; with no number shown.<p>As far as I can tell, the change is independent of the number of comments and there doesn&#x27;t seem to be any particular length of time from when the story was submitted that triggers the change. The behaviour also seems to be different depending on whether you are logged in or not.<p>I know it is only a minor aspect of the site, but I have been curious about how it works for a while. Also, what was the logic (if any) in taking this approach?
======
dang
I am not PG either but I believe that wglb is right: the number of comments is
shown for items in RAM, but not for items on disk. Recent items are held in
RAM, but not all older items are.

Changes in behaviour when logged out are likely due to caching. We can cache
the logged-out pages more aggressively since they're shared by all logged-out
users.

------
wglb
I am not PG (nor have I been for some time) but I once heard it explained that
this is due to the fact that after memory fills up, comments are cached to
disk, and this is represented by the "comments" tag rather than the actual
count. If someone clicks there, I believe the number will show again.

------
_gbc
Thanks wglb and dang. At least now I can stop trying to work out the (non-
existent) pattern!

