One difficulty arising from this feature is a namespace collision. This is most evident when dealing with two replies to the same parent writeup, but it could occur with identically named top-level postings as well. How do you refer to a writeup by name when that name occurs multiple times in the database?
I see five possible solutions. Three are behavioral and two are technical.
- Use the special ID linking technique. This requires you to find the correct node number. It's not too difficult, but it's not as convenient as the simple bracket linking to title. However, when done properly, it's very accurate.
- Link to the parent post of a discussion. If someone has already asked a similar question and received good answers (the post should become a Categorized Question with Answers, yes), link to the parent query and mention that the ensuing discussion brought up good conclusions. This is easier to link, if there's no title collision, and it gives a broader overview of the answers.
- Prepend individual replies to top-level postings with a unique string, such as (kudra) or (chromatic). This makes reply titles more unique (more so than 'Re: Re: Re: foo', anyway). It has the disadvantage of propogating your identifier through any replies to your post, if replying monks are too lazy to edit the titles. It is also susceptible to collisions, if you were to reply to two same-level postings in the same discussion, and neither of the parent notes followed this rule. It's also a little ugly.
- Create one new linking type -- a SQL-type link. Posters could specify title and author, and the Everything SQL engine could return a list of possible matches. This does require mucking about in the internal linking methods, and it does introduce more load onto the server, but if results were cached and transformed into a normal ID link, the penalty would only be there once. (Of course, having stronger search capabilities would allow posters to do this for themselves.)
- Store threading information in the database and allow that to be linked. Writeups currently do store some threading information. There's probably a field in the question table for parent_id. (I'm guessing, as I have not seen the db tables for this particular site.)
spudzeppelin has come up with a unique way to handle threading and sorting. Give each writeup a new 8-digit number corresponding to its place in the nesting hierarchy. The first post would be 00000000. The first reply would be 00000000x00000001, and so on. Replies inherit and extend parent threading number information. (If you're concerned about taking up space in the database, simply pack the numbers.) Sorting into a threaded model is a snap -- instead of having to create a tree, you can simply use a numerical sort to arrange things correctly. However, if you prefer to sort by score, this won't work for you.
A similar option is to implement some sort of DOM-like model which applies to posts. You might be able to link to The Threading Dilemma:1:2 for the second reply to the first reply. (Again, your sorting order will affect this.)
After considering this, I consider the first to be the simplest and most effective. Though I have been prepending my username to my replies, I don't think it solves the underlying problem. If an XML interface to the Everything Engine becomes practical in the next year or two, hopefully the discussion will move from 'ease of displaying information within HTML limitations' to 'properly marking up data for user-determined display in XML clients', and we can be more efficient with both server resources and our own time.
Are there other solutions? Are there benefits and drawbacks I've overlooked? What do you prefer?