Live data from Hacker News

Probably the worst URL scheme ever

bvb.de

51–60 of 106 posts

Re: Probably the worst URL scheme ever

#51
post #28

Earlier quoted context omitted.

I never understood why HN has such a peculiar URL for accessing pages. It times out after a while too, is that to stop crawlers?

They are ids to lookup closures in a database. They time out to stop the database overflowing ;) It's called continuation-based web development [1], popular with Lisp and Smalltalk-based web servers (because who else has continuations?) [1] http://en.wikipedia.org/wiki/Continuation#In_Web_development

There's no database.

EDIT: to all the people arguing with me. Read the source code to Hacker News.

    (= fns* (table) fnids* nil timed-fnids* nil)

    ; count on huge (expt 64 10) size of fnid space to avoid clashes

    (def new-fnid ()
      (check (sym (rand-string 10)) ~fns* (new-fnid)))

    (def fnid (f)
      (atlet key (new-fnid)
        (= (fns* key) f)
        (push key fnids*)
        key))

    (mac afnid (f)
      `(atlet it (new-fnid)
         (= (fns* it) ,f)
         (push it fnids*)
         it))
They are in memory. Which is why they expire randomly when the HN process is restarted.

Re: Probably the worst URL scheme ever

#52
post #41
post #39

i have seen worse. i.e. sites that show on page with the url http://www.example.com and another page with the URL http://www.example.com and even after another click the URL http://www.example.com with completely new content and sites, that use a logic like this http://www.example.com/357893857435/sfjsfsfsfd/this-should-b... where http://www.example.com/357893857435/sfjsfsfsfd/this-is-shoul... and http://www.example.…

Quite frankly, I despise the use of "SEO URLs" altogether. It's basically a waste of bytes.

Sometimes, sometimes not. You can often compress a lot of

&parameter=value into a simple /value/

rewrite. This - by most accounts - makes it more SEO friendly. Granted, putting full sentences that match an article title is never necessary, but there are a lot of SEO tricks that can make a url not only "nicer" looking but also shorter.

Re: Probably the worst URL scheme ever

#53
post #47
post #44

Earlier quoted context omitted.

No, I think it is just a joke: if you parse "*2" as "times two" you could optimize it in code by shifting the bits left since bit shifting operations are cheaper than multiplication. #b0001 = 1 #b0010 = 2 #b0100 = 4 #b1000 = 8

Haha thanks for the explanation.

And to continue on this tangent, if your code is multiplying by the constant 2 (e.g. "x = z * 2") the compiler's probably going to optimize that into a shift anyway, so just keep the "* 2" to keep future human readers of the code happy.

Re: Probably the worst URL scheme ever

#54
I think THOMAS (http://thomas.loc.gov/), the search engine provided by the US Library of Congress for searching federal legislation, has the worst URLs I've seen. Here's a random one:

  http://thomas.loc.gov/cgi-bin/bdquery/D?d113:1:./temp/~bdGqLa:@@@T|/home/LegislativeData.php|
And here's a link I got to the Patriot Act (HR 3162):

  http://thomas.loc.gov/cgi-bin/query/D?c107:44:./temp/~c107DgA33R::

Re: Probably the worst URL scheme ever

#55
post #48
post #37

How about http://www.tsa.gov/tsa-pre%E2%9C%93%E2%84%A2 ? It's "TSA-Pre✓™" and you have to type in the checkmark and the trademark symbols, otherwise it 404s Edit: ho, they fixed that and it's redirected. Too bad, that was funny :)

"I can't imagine the skill required to do this without the experience to know it's a bad idea" (can't find the source for this quote, but you should get the sentiment). ...ahhh... found it: """"How do you attain the skills required to do this while not also learning not to?" http://news.ycombinator.com/item?id=4711355 """

The way you end up with URL's like http://www.tsa.gov/TSA-Pre✓™ is a CMS system that replaces spaces with dashes in the title to make the URL. No skill required.

Re: Probably the worst URL scheme ever

#56
post #15

LinkedIn URLs are by far the worst. For example, the first profile that came up when I searched for Paul Graham: http://www.linkedin.com/profile/view?id=23081590&authTyp...

You can have a public URL for linkedin in the format /in/CustomName

E.g.:www.linkedin.com/in/barackobama

Re: Probably the worst URL scheme ever

#57
post #5

Can anyone tell the advantages of having unreadable URLs like this? The only thing I can think of is reducing bandwidth usage through short URLs :)

You've got to go green by conserving bits. You can use up to a radix of 30 I believe in JS, so why use those pesky base 10 values when you can go base 30 with no additional overhead? Heck, use base 62 for the easily url passable values too. Just 4 chars to encode your 14M WP articles.

Think of the bits!

Re: Probably the worst URL scheme ever

#58

Earlier quoted context omitted.

They are ids to lookup closures in a database. They time out to stop the database overflowing ;) It's called continuation-based web development [1], popular with Lisp and Smalltalk-based web servers (because who else has continuations?) [1] http://en.wikipedia.org/wiki/Continuation#In_Web_development

There's no database. EDIT: to all the people arguing with me. Read the source code to Hacker News. (= fns* (table) fnids* nil timed-fnids* nil) ; count on huge (expt 64 10) size of fnid space to avoid clashes (def new-fnid () (check (sym (rand-string 10)) ~fns* (new-fnid))) (def fnid (f) (atlet key (new-fnid) (= (fns* key) f) (push key fnids*) key)) (mac afnid (f) `(atlet it (new-fnid) (= (fns* it) ,f) (push it fnids…

Depends on what you consider a database.

Re: Probably the worst URL scheme ever

#59

I think THOMAS ( http://thomas.loc.gov/ ), the search engine provided by the US Library of Congress for searching federal legislation, has the worst URLs I've seen. Here's a random one: http://thomas.loc.gov/cgi-bin/bdquery/D?d113:1:./temp/~bdGqLa:@@@T|/home/LegislativeData.php| And here's a link I got to the Patriot Act (HR 3162): http://thomas.loc.gov/cgi-bin/query/D?c107:44:./temp/~c107DgA33R::

Making sense of that in linear time would be a great interview question.

Re: Probably the worst URL scheme ever

#60

I think THOMAS ( http://thomas.loc.gov/ ), the search engine provided by the US Library of Congress for searching federal legislation, has the worst URLs I've seen. Here's a random one: http://thomas.loc.gov/cgi-bin/bdquery/D?d113:1:./temp/~bdGqLa:@@@T|/home/LegislativeData.php| And here's a link I got to the Patriot Act (HR 3162): http://thomas.loc.gov/cgi-bin/query/D?c107:44:./temp/~c107DgA33R::

Why? Surely you'd have to go out of your way to make it that unnecessarily complicated.
Post reply on HN