Re: [whatwg/url] [Editorial] Replace the term 'cannot-be-a-base' with hierarchical/non-hierarchical (#634)

My view on this is that, for someone new to the URL specification, the terms _cannot-be-a-base-URL_ and _hierarchical_ are equally opaque. I mean, _I_ understand where each term came from. But at the end of the day, neither term really gives the new spec reader a mental picture of what these URLs look like – even though they are likely to think they have a good idea on what a URL is!

Given that we cannot find a consensus on solely technical grounds, I think pragmatic concerns should be considered:

- Cannot-be-a-base-URL is a mouthful by itself. Using it in a sentence is even worse: "URLs whose cannot-be-a-base-URL is true".

   Granted, we can probably add some syntactic sugar (like "if URL cannot be a base URL, then"), but it is still a lot of words in a word – for English at least.

- "Hierarchical" as a word to describe this property is already familiar to many users. Rust-url definitely exemplifies this usage, but also Chrome's internal URL classes all use "hierarchical".
- People have already pointed out "hierarchical" came from RFCs published by IETF. With such an old and entrenched concept, I think there's value in keeping an old name even if it is not technically the best choice for this concept.

In balance, I tend to prefer hierarchical/non-hierarchical over cannot-be-a-base-URL. However, I'd like it if folks can also entertain the following proposals:

- **rootless URL**: I've seen "rootless" as a term to describe these sad URLs. But that's not quite technically correct either: scheme://example.com doesn't have a path (much less a root), but can be a base URL.
- **opaque-path URL**: describes the fact that the path is opaque (i.e., you can't do algebraic operations on it (`.`, `..` and such) the way you can with file paths). Unlike "hierarchical", one can more easily infer that a URL with opaque path cannot be used for relative resolution. And unlike "cannot-be-a-base-URL", "opaque-path" establishes how the URL looks: there's something weird about the path!

   "Opaque" is also the word [Go](https://pkg.go.dev/net/url#URL.Opaque) decided to use for a field in the URL structure, so there is precedent.

- **sad URL**: these URLs tend to make people (well, those trying to specify URLs at least) sad. At least five issues on this issue tracker and many more have been solely dedicated to make these URLs sort of work. Not sure about everyone else, but whenever I see one of these URLs, I get sad. It also just happens to be the case that "sad" is the shortest contender out here, and terseness is underrated.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/634#issuecomment-930695657

Received on Thursday, 30 September 2021 02:19:47 UTC