News for hackers. Stuff that matters.
Re:You Don't Need UUID by richbell on Monday September 11, 2023 @01:22PM (#37470461)
> Does it make the URL in the URL bar longer? Yeah, but does that matter?

Yes. That's one of the author's arguments.

) A simple ID like 3c6n63N is more than enough to represent any product while keeping it readable and making communication easier. A UUID alternative like a73ba12d-1d8b-2516-3aee-4b15e563a835 is just wasteful from an user’s perspective.

Re:You Don't Need UUID by dragonwriter on Monday September 11, 2023 @01:32PM (#37470618)
The point of a UUID is to have a unique machine ID that can be generated in parallel by separate, non-synchronized processes.

You don't need to make it a user exposed identifier, and you can have a centralized (but out-of-the-critical-path) process assigning friendly IDs if you can afford visibility delays (for either the whole item or at least the friendly ID, which if it is the only user-facing locator may mean that the individual item can’t be directly accessed even if it is visible in aggregates, until that is assigned; if you allow access by both the UUID and the friendly ID, with the latter presented as preferred once available, this is resolved but this may appear messier.)

Re:You Don't Need UUID by Turing_Machine on Tuesday September 12, 2023 @11:04AM (#37482387)
Exactly. Also, not everything is going to be an URL, or human-visible at all.

Others have noted the usefulness of generating ids for user-created data without involving the server, while being able to post that data at a later time without worrying too much about collisions.

Suspenders-and-belt practice would of course dictate that the server do some type of collision detection and mitigation before storing the received data.

    If UUID exists in database and user ID is different, tell client "Yo, we've got a collision here. Your new ID for this data is blah".
On the client end, when creating the data,

    Generate new UUID. If I've ever used that UUID before, generate a new one.
When the client saves the data to the server

    If the server rejects my UUID, switch to the new one provided by the server
In practice the collision mitigation code is likely never to be called, even in a very large system. The people who designed UUID went to great lengths to ensure that.

Personally, I'd look on home-brewed solutions for generating unique "friendly ids" with the same deep suspicion I look at home-brewed crypto, particularly if this were done client-side for multiple clients without involving a server round-trip. Getting it right is a Hard Problem. The perceived complexity of UUIDs is there precisely because it is a Hard Problem.

Re:You Don't Need UUID by appletrotter on Monday September 11, 2023 @01:26PM (#37470515)
Maybe it’s one if the author’s arguments, but that doesn’t mean the author is right.
Re:You Don't Need UUID by richbell on Monday September 11, 2023 @01:28PM (#37470552)
Sure — it's just a weird question to pose when the author specifically provides their opinion on it. It'd be different to say "I don't think it matters".
Re:You Don't Need UUID by Petersipoi on Monday September 11, 2023 @01:39PM (#37470727)
You're just nitpicking.

"Does it matter" is a very reasonable response to someone expressing their opinion.

Re:You Don't Need UUID by richbell on Monday September 11, 2023 @03:47PM (#37472659)
It's not nitpicking.

If I say "x matters and here's why" and you respond "yeah but does x matter?", you're either not paying attention or being rude and dismissive.

Re:You Don't Need UUID by NBJack on Monday September 11, 2023 @01:27PM (#37470541)
There is the rub. Readable for what purpose? Aesthetics? And why? It is meaningless in their example.

And what do they mean with communication? Reading it aloud? If the URL is too long to stick in a tweet or message, there are plenty of URL shorteners out there.

Re:You Don't Need UUID by skybrian on Monday September 11, 2023 @01:35PM (#37470678)
Copying very long URL’s into a Markdown document or a social media post is pretty annoying. URL shorteners are opaque and add a point of failure.

On link-sharing sites like this one, we care about the URL’s we share and will often strip off the tracking stuff.

Re:You Don't Need UUID by croes on Monday September 11, 2023 @01:30PM (#37470579)
Must be oral communication, otherwise copy and paste the link.

And I bet that for most users 3c6n63N is as confusing as a73ba12d-1d8b-2516-3aee-4b15e563a835

Re:You Don't Need UUID by insanitybit on Monday September 11, 2023 @01:47PM (#37470847)
I guess in the rare instance where you're literally reading a URL out loud it would help. Most of the time you're sending a URL, at which point length is mostly irrelevant as you're "copy/paste" on both sides.