3 ms·
> Nobody’s surname needs 128+ bytes. No reasonable URL for a firmware update download needs 4096 bytes. ...and surely the "seconds" field of a timestamp is alw
by dark-star 2y ago
> Nobody’s surname needs 128+ bytes. No reasonable URL for a firmware update download needs 4096 bytes.
...and surely the "seconds" field of a timestamp is always between 0 and 59 inclusive, addresses will include a state and a building number, phone numbers contain only digits and maybe a leading + sign, etc.
Wrong assumptions like this are one of the root causes of (in the best case) bad UI or (worst case) annyoing bugs.
128 bytes for a surname is only about 60 unicode characters, less if you include RTL markings and characters outside the BMP.
A URL can contain SHA hashes (think: reproducible builds) and can thus be very long (okay, 4k characters is pushing it quite a bit but I wouldn't rule it out like you did...)
- smaudet 2y ago> Wrong assumptions like this Assumptions, or features? I'm all for inclusive behavior, however I'm also for well tailored solutions. Having support for 8k characters when you are going to usually use maybe 20 isn't smart or correct either. That's why we have utf-8, not utf-32, you can grow the bytes when you need to, but only then. > A URL can contain SHA hashes It can, or it can not - again, perhaps a feature, not a bug. The hash can also live in a file named by convention, and downloaded/checked separately. Maybe there are other scenarios where you might need a really long url, but domain + release path + name + major.minor.patch should get you 99% of the way. What's "reasonable" is relative, always designing for the edge case is good in some cases, but its also OK (and perhaps better) to optimize on occasion.
- bigstrat2003 2y agoThere have to be limits somewhere. Memory and storage space is not infinite. On the other hand, "how many characters can someone have in their name" is infinite. That means that no matter what limit you choose, someone will eventually exceed that limit. And you have to have a limit. This is not a matter of "wrong assumptions". At the end of the day, all you can do is set a limit such that you're comfortable with the risk that someone will be outside the limit you have set. And risk tolerance, as always, is a matter of opinion and not fact.
- margalabargala 2y agoThis is a poor argument. Firstly, "how many characters can someone have in their legal name" is decidedly not infinite, because it has to be sufficiently short that some governmental entity was willing to record it. Secondly, as a reply to a comment (quite reasonably) pointing out that 60 unicode characters may not be enough for a surprisingly large number of people, this makes even less sense. Memory and storage space are not infinite, but 128 bytes per name is still unreasonably low. One could buy a single 12TB hard drive and store the names of every single living human, allocating 1.5KB per person.
- jquery 2y ago> it has to be sufficiently short that some governmental entity was willing to record it. How short is that, exactly?
- margalabargala 2y agoIt's not hard to apply an upper bound here. If you arrive at a government office when they open for the day, and try to spell out your name to the clerk, and are unable to finish before the office closes for the day, that name is too long. Realistically they will probably tell you to leave well before that. No one will have a legal name longer than the legal system will allow them to have.
- bigstrat2003 2y agoThe point is, you are always going to exclude some number of people's names when you set constraints. So you have to decide what is right for your use case, just like with any other engineering decision. There's no such thing as "right" or "wrong" here, simply what is best for the context. 128 bytes for a name is going to be unreasonably low in some contexts (e.g. for Arabic names), but not for others (e.g. for American names).
- rat87 2y agoWe live in a global society and there are plenty of Arab Americans so Arabic names are American names.
- dhosek 2y agoWhen I was in college, the only number in my mailing address was the zip code.