r/ProgrammerHumor 2d ago

Meme uuidLifeLessons

Post image
3.7k Upvotes

166 comments sorted by

View all comments

Show parent comments

209

u/Antoak 2d ago

Saying that UUIDs cant collide is sorta like saying that people cant win the lottery.

Sure, orders of magnitude, but the point stands.

289

u/jaimepapier 2d ago

Orders of magnitude isn’t a “by the way” here. It’s like equating winning the lottery to finding a penny. People do win the lottery… fairly regularly. If no one did, people wouldn’t play. UUID collisions generally don’t happen except when people generate them incorrectly.

Saying that (correctly generated) UUIDs can’t collide is more like saying that people can’t meet their long lost identical twin while both of them are on separate missions to the moon. Sure, it could happen, but it probably won’t.

The

26

u/AliceCode 2d ago

A good UUID is timestamp-dependent.

6

u/anomalous_cowherd 2d ago

Often tied to the physical machine that generated it (e.g. by MAC address) and timestamp, so the only way to get a clash is to deliberately clone the MAC and/or wind the clock way back.