Hacker News new | past | comments | ask | show | jobs | submit login

Just think about logging polymorphic object IDs. If you see an identifier with a type you can immediately know what table it is in and you can even build super simple tools like browser extension that let you look up objects by IDs as is. You can also just share these IDs as is with folks on Slack to debug etc. and they know exactly what kind of entities you are talking about.

Super useful and I honestly don't wanna go back to a project that doesn't use this pattern.




Those debug IDs (or URLs, etc) are worth having for the reasons you describe, but it doesn't mean you use those as primary keys in the DB. Something only needs to print them, and debug tools need to understand them.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: