· 01:23
In this episode, we dive into a quirky and controversial take on generating UUIDs that’s both inefficient and delightfully wrong. The article "CodeSOD: Uniquely Expressed" from The Daily WTF highlights a method where instead of using a standardized library, a developer opted to "fill in the gaps" using regular expressions. The piece explains how the code crafts a UUID string by replacing characters in a format string with random hexadecimal digits—a technique that, while it works, is both awkward and prone to errors, such as "a high probability of collisions due to bad randomness." The editor laments this approach by noting that it “confuses the representation of the data with the reality of the data,” because a UUID is fundamentally 128 bits of numerical data, not just a dash-separated hex string.
Key Points:
Listen to jawbreaker.io using one of many popular podcasting apps or directories.