Choosing Between int and string for Storing QQ Numbers
While storing early five‑ and six‑digit QQ IDs as int32 or int64 offers memory efficiency and fast queries, the later expansion to eleven‑digit numbers and potential inclusion of non‑numeric symbols makes a string representation preferable to ensure flexible, future‑proof handling of QQ numbers.
The article debates storing QQ numbers as an int versus a string .
Early QQ IDs were five‑ or six‑digit numbers, so Tencent used int32 then int64. Later IDs grew to eleven digits and may include symbols.
Integers are memory‑efficient and fast for queries, but they restrict format changes, as seen with ID numbers that later added letters.
Therefore the author suggests using a string to handle variable length and non‑numeric characters, ensuring future flexibility.
Java Tech Enthusiast
Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.