top | item 23254264

(no title)

mdouglass | 5 years ago

Why is that?

My google-fu only turns up references to invalid utf-8 data, but that didn’t sound like what you were referring to.

discuss

order

jeffbee|5 years ago

string and bytes are the same on the wire but generate different application code. string is defined to be utf-8, so if you are planning to put arbitrary bytes in there, you can't use that type. in some languages string is checked for utf8 conformance, which is expensive. In some languages allocating strings is more expensive than allocating bytes.

Only use string when you really mean utf8.

rakoo|5 years ago

Isn't that still ok for keys ? You typically want keys to be human-readable and -writable strings anyway