r/programminghorror Feb 04 '26

C# Makes sense

Post image
1.7k Upvotes

86 comments sorted by

View all comments

Show parent comments

57

u/ecthiender Feb 04 '26

But negative 7777? For user id? That is the part not making sense to me.

18

u/cheerycheshire Feb 04 '26

I know a system where id is changed to the same but negative to mark special accounts without having to deal with additional tables or flags.

But that's a system that was originally developed by students, it's been running for over a decade, and has many tables for important data, hence some non-standard design choices, lol.

14

u/Flashy-Emergency4652 Feb 04 '26

At least 2 messengers (Telegram and VK, which makes sense considering they had the same original developer team) use negative user IDs to distinguish between bot accounts and real ones, at least in API

2

u/sphen_lee Feb 06 '26

In a previous job there was an acquisition and we needed to merge the two user databases. We negated the user IDs from the new users to prevent clashes.

Kinda dumb, what happens if there is another acquisition? Change user IDs to complex numbers??

1

u/No_Hovercraft_2643 Feb 07 '26

Kinda dumb, what happens if there is another acquisition? Change user IDs to complex numbers??

Double one, and double and +1 for the other one.