w3c/badging

Why not `unsigned long`?

Closed this issue · 2 comments

Any reason not to use unsigned long instead of long? Then WebIDL automatically handles the -N case.

Per https://w3ctag.github.io/design-principles/#numeric-types, this should be unsigned long long. Seems unnecessary in this case to have 53-bit instead of 32-bit ints, but if this is the standard advice I'm happy to take it.

The idea behind the unsigned long long advice is that it's unnecessarily arbitrary to say that 2^32 - 1 is the limit. A reasonable limit for this domain might be something like 999 or 9999 or similar, but if we don't have a domain-specific limit, then "JavaScript's INT_MAX" better than arbitrarily picking 2^32 - 1.