5 ms·
Why didn’t they add a string limit?
by Apocryphon 5y ago
Why didn’t they add a string limit?
- userbinator 5y agoPerhaps the limit was "available memory"? It's not hard to imagine how a programmer who has only ever worked with dynamic languages and basically doesn't know what a fixed-length-buffer is could be completely oblivious to it. Then again, what is an appropriate limit on the length of the name of a HomeKit device? I'm tempted to say 255, but I'm sure someone else would disagree. I've been in design meetings where such things were discussed, with lots of bikeshed, so it's also understandable that, with deadlines and other priorities, they decided not to impose any limit.
- sodality2 5y agoI can't imagine anyone would disagree with 1024 characters.
- userbinator 5y ago"But that doesn't fit in a byte; why not make it 64k instead so it's 2 bytes?" "Why not 1023?" "Even 1023 is too long, I don't think anyone would need that." "What if <long and convoluted use-case>?" "How about 32?" Having been in a few meetings that went in that direction, I am not surprised that they couldn't agree on a limit. "Design by committee" at its worst.
- prox 5y agoAnother team that didn’t read nor adapted practices from About Face : on interaction design. What the team wants is irrelevant, how the user will adopt it is important, and for that you need to actually do tests.
- sebastien_b 5y agoI doubt it even went that far - given the size the story mentions (500,000 characters, but isn't clear if they tried smaller), my thinking is the programmer didn't make any checks whatsoever and just thought "no one will type in crazy-large values here, and even if they do it'll just truncate on display" (if that) without consideration on how it might affect memory.
- viktorcode 5y agoDon't know, but in general arbitrarily set limits are bad. Note, the bug is not in the long name. The bug is in the inability of system services to handle a long device name. That I imagine is hard to fix, but this is exactly what needs fixing. Limiting the name length is akin to band aid.
- userbinator 5y agoIn theory I would agree, but in practice (which is different from theory, as the classic saying goes), I disagree; I have another comment here about the perils of debating limits, but I don't think designing the system to handle 500,000-character names would be a good thing either, because we know from experience that if something can be abused, it will. Needlessly making something "limitless" is an invitation to test that --- and in the real world, we know that there definitely are limits even if they are as volatile as "available memory"; and doing something like that is not good for reliability.
- lkxijlewlf 5y agoNo arbitrary limitations.