Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

in monktitlebar, link to sections by id?

by jdporter (Canon)
on Feb 06, 2006 at 22:40 UTC ( #528362=pmdevtopic: print w/ replies, xml ) Need Help??
jdporter has raised the following topic:

You've probably all seen the recent discussion, Change Find Nodes "Saints in our Book".
In it, someone said "the Monastery is based on nodes IDs and not names," by which he presumably meant linking.

So it got me thinking about this issue, which has probably been raised before:
Would(n't) it be better if the links in the monktitlebar were ID links, rather than title links? I think it would, but I'm not sure why...

Update 1: In response to Tanktalus' comments below, I'll clarify my proposal as follows: The links should all be constructed using the [id://123|Text] format.
This means:

  1. Link texts are statically customized for the context, and are immune to changing actual node titles;
  2. Target nodes are absolutely certain, because node IDs are unique, and node lookup by ID is optimal.

The following benefits obtain:

  1. No server load incurred for looking up titles at page render time;
  2. No server load incurred for node searching by title at "click" time.

The downsides:

  1. If it is deemed propitious to modify a link's text, it is done to the link, not to the target node's title. (This could be an upside; it all depends on the situation.)
  2. If a target node is superceded by a new node, the link(s) to it must be changed to use the new ID.

In my estimation, the upsides far outweigh the downsides.

Update 2: I'll amend the proposal to be generic, i.e. applicable to all "high-visibility, high-traffic" links on/to site docs/functions. IOW, not just the monktitlebar, but also links in cabalistic nodelets and various superdocs, sectioncontainers, etc.
(This topic has definitely been discussed before, but danged if I can find a PMD for it. Perhaps we can put this puppy to rest. ;-)

We're building the house of the future together.

Comment on in monktitlebar, link to sections by id?
Download Code
Re: in monktitlebar, link to sections by id?
by Tanktalus (Canon) on Feb 07, 2006 at 00:46 UTC

    As was also pointed out, the monastery is based on both node ID numbers and names. Thus, whether you use [Super Search] or you use [id://3989], you'll get to the same node. The only times there is a difference are when either the name matches more than one node, or when the name doesn't completely match any node.

    So I'm not seeing really any significant benefit in changing the title bar from names to IDs except to annoy the heck out of whoever has to write the change. ;-)

    Theoretically, lookup by number could be faster for when they're clicked on. But good indices probably take care of that, more or less. And using names reduces lookups at rendering time - it takes no (database) effort to convert [Super Search] to "Super Search", but if you use [id://3989], then PM needs to do a lookup every time the node is rendered to provide the title. (Ok, so these ones have a good chance of always being in the cache.)

    In fact, if we want to help reduce the rendering effort a bit, we should use the names exclusively - the number of times a link is rendered versus being clicked on must favour this method.

    To that end, I would propose a couple of minor changes (heh heh):

    1. The code that does the node linking would stop doing lookups. Instead, the code that converts the URL-like links (id://, http://, etc.) would do the lookup if required (which I think is only id://). And it wouldn't do any lookup unless no title is given (via the pipe).
    2. The link created would have some sort of hidden attribute, say "alt", which would have the original text.
    3. holli's firefox plugin would use the alt tag if it's a perlmonks URL that is being clicked on rather than the href.

    Or that seems to me like a reasonable way to help reduce the overhead.

    Now, to take the opposing side of this idea for just a moment, I have two words for me: "Premature optimisation!" Unless someone thinks we're using up too much CPU time with this, and thinks that such a plan could possibly have a significant enough effect to warrant the effort, it's not really worth doing.

    Which means, now that I'm near finished, that I don't think a change of any type is really warranted ;-}

Re: in monktitlebar, link to sections by id?
by VSarkiss (Monsignor) on Feb 07, 2006 at 20:46 UTC

      I'd like to agree with you. It sounds really nice. But... Tutorials doesn't work so well in practice.

      I think the underlying point is that linking by title is a great convenience for users writing user-level nodes, people talking in the cb, and so on. I totally agree with that. But I don't think that corresponds to a principle that linking by title is better for links in/to high-visibility, high-traffic pages under "site" management.

      We're building the house of the future together.
Re: in monktitlebar, link to sections by id?
by ysth (Canon) on Feb 08, 2006 at 00:41 UTC
    In the site documentation, links should always be by id, but I'd leave the title bar alone; I'd like people to be able to go directly to those nodes by title anyway. Having it that way in the titlebar provides a better opportunity to notice when some malicious or playful user titles some other node inappropriately.
      I'd like people to be able to go directly to those nodes by title anyway.

      Agreed; but my proposal won't affect that, because that's strictly an issue of how well (simply, uniquely) the nodes are named.

      ...provides a better opportunity to notice...

      I'm not sure that should be an overriding consideration.

      We're building the house of the future together.

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2014-12-29 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (191 votes), past polls