3 ms·
why? The advice to never let users see PK's (basically keep them secret?) is new to me.
by jrochkind1 5y ago
why? The advice to never let users see PK's (basically keep them secret?) is new to me.
- marcosdumay 5y agoBasically, if users see them, they will do "human things" with them, like developing a preference ("hey, that customer is deeply annoyed that we identify them by the number 666, can you change it?"); argue about the rules ("why do customer numbers go from 1, 2, 3 to 21? this is wrong"); correlate and replace it with other identifiers that they will always guarantee that are 1 to 1 with them, but never really are; and a lot of other stuff you or me will never expect. All of the columns in a table are fit for human manipulation, the only exception is the primary key that has informational rules, so use some other column if they need a key. It's not "keep them secret", it's "this data is for developers eyes only", it doesn't matter a lot where the developers are, only that they know the rules.