Live data from Hacker News

Examples of Great URL Design (2023)

blog.jim-nielsen.com

151–160 of 163 posts

Re: Examples of Great URL Design (2023)

#151

Everything should be accessible via the identity of its composition (a hash or equivalent). Then all the data needed to render it be computed or downloaded from some peered cache (DHT).

So when you bookmark the Hacker News frontpage, that would be a hash of its current content and then you will visit that stale stale version forever and never see any new stories?

a version of it lives forever. You can associate siblings/changesets based on hash linking.

https://sentido-labs.com/en/library/201904240732/Xanadu%20Hy...

Something like Xanadu tumblers.

Re: Examples of Great URL Design (2023)

#152
post #2

An example of a not-so-great URL design: Amazon product links have an optional slug before everything else like `{slug}/dp/{id}`. So you end up copying a gigantic URL everytime you wish to share a product unless you use the share product button to get the shortened link.

I think this is actually a really great design in that the name of the product can always be in the URL. The "slug" is completely ignored and just there for SEO/humans. If you send a link I instantly know what it's for -- that's pretty useful! I also like that the "id" which is an ASIN (Amazon Standard Identification Number) which is a superset of all ISBNs. This means you can just enter any book ISBN directly into t…

>>Amazon product links have an optional slug BEFORE everything else

>I think this is actually a really great design in that the name of the product can always be in the URL

he said "before". you could accomplish your goal putting the slug "after". he's making the point that having a place after which you can harmlessly delete the rest of the url is better than having embedded NOPs surrounded by identifying information (not that the average user will ever edit any url, but there is still merit in what he said that you missed, and he's not disagreeing with you)

Re: Examples of Great URL Design (2023)

#154
post #2

An example of a not-so-great URL design: Amazon product links have an optional slug before everything else like `{slug}/dp/{id}`. So you end up copying a gigantic URL everytime you wish to share a product unless you use the share product button to get the shortened link.

> So you end up copying a gigantic URL everytime you wish to share a product Yeah, when I used Amazon I found this incredibly annoying. When I wanted to share a link, I'd have to spend a few minutes figuring out how much of that stuff I could remove and testing the resulting URL before sharing it. A relatively minor irritation, but an irritation nonetheless.

having, like you, studied amazon urls, I just automatically delete everything?inclusive after the "?", then I edit the slug to make it contain a message personalized for my recipient

Re: Examples of Great URL Design (2023)

#155

The Slack URL scheme, and a few others mentioned in other comments take me right back to hp.com/go/ , so hp.com/go/proliant would take you to Proliant servers, maybe. The idea was really cool, but from talking to people at HP at the time, the implementation was apparently a complete nightmare done with an insane number of rewrites. It was sort of a hit and miss if the thing you typed in after /go/ would actually take…

How was the implementation hard? It seems like it would be a bog-standard set of redirect rules.

It was the shear amount of them that was the problem. Plus this was in the early 2000s and they where, if I recall the story correctly, manually managed.

Re: Examples of Great URL Design (2023)

#156
post #138

I’m glad this article mentions GitHub, who have had some of the best URL design I’ve ever seen, and have done since they first launched. I use that ALL the time. I can navigate straight to any issue by typing a URL. I can switch to the “actions” view for a repo by adding /actions. I can see the file I’m looking at in a branch by editing the URL and swapping “main” for the branch name. All available via the UI as well…

do these routes on github irk anyone else: /issues/ /issues/:id /pulls/ /pull/:id

Even worse:

    /issues/
    /issues/:id
    /pulls/
    /pulls/:author
    /pull/:id

Re: Examples of Great URL Design (2023)

#157
post #10

One big question in URL design is this: Do path parameters get to have / in their values? Let’s say you have a link shortener service and want to allow users to define shortcuts like /mypath/:rest where rest is appended to example.com/ Now you’re in a very interesting position when it comes to resolving URLs. Curious to hear folks with experience in this

Actually, not encoded slashes in the paths are not that unheard of as one might think. As an example, this is actual Wikipedia article about... the meaning of "two slashes": https://en.wikipedia.org/wiki/// . Also, encountering buggy concatenations like example.com//some-path or example.com/base//some-path is quite common.

Don't ask how I know.

Re: Examples of Great URL Design (2023)

#158

We take the typical blog url design (/2024/08/14/slug) for granted but back in the very early 2000s pretty much every blog tool had its own URL design. Matthew Thomas back then took an inventory: https://web.archive.org/web/20030810201315/http://mpt.phrase... He was on the search for his ultimate blogging system, where this "cruft-free" URL structure should be used: https://web.archive.org/web/20051107103030/http://m…

I guess this reflects a view of blogging that maybe is more what people today would use twitter or mastodon for, with lots of blogposts with the same title like "open thread" or "links for sunday". Today people mostly use blogs to publish essays, and then a slug based on the title should be sufficient, since you're not going to publish two essays with the same title. That's what substack uses.

You're onto something: Very early blogs around the millennium where often build around very short paragraphs; not big articles. Take a look at these; if one squints those looked far more like later Twitter streams:

https://web.archive.org/web/20020603092331/http://www.kottke...

http://scripting.com/2001/09/11.html (Every paragraph is in effect an "entry")

Then in the early 2000s blogging resulted in a style with longer articles instead of paragraphs. In the middle 2000s a "retro" style begun with far shorter and differentiated entries, the so-called tumblelog:

https://kottke.org/05/10/tumblelogs

The original Tumblr may have been inspired by this, if not just the name.

And then Twitter and other social media arrived on the scene and ate everything. :/

Re: Examples of Great URL Design (2023)

#159

Earlier quoted context omitted.

.htm and .html is relevant just like .pdf and .zip etc etc But I agree about .php, .aspx and other extensions that are telling something about the server side. That’s irrelevant for the user.

> .htm and .html is relevant just like .pdf and .zip etc etc it's _kind of_ relevant, if it weren't for the fact that the absence of any extension implies .html >99% of the time

Forever and always .html, because: AESTHETICS

Re: Examples of Great URL Design (2023)

#160
post #138

I’m glad this article mentions GitHub, who have had some of the best URL design I’ve ever seen, and have done since they first launched. I use that ALL the time. I can navigate straight to any issue by typing a URL. I can switch to the “actions” view for a repo by adding /actions. I can see the file I’m looking at in a branch by editing the URL and swapping “main” for the branch name. All available via the UI as well…

do these routes on github irk anyone else: /issues/ /issues/:id /pulls/ /pull/:id

Yes! I really wish they would at least set up /pulls/:id to redirect to /pull/:id
Post reply on HN