Code Smell 160 - Invalid Id = 9999
TL;DR: Don't couple real IDs with invalid ones. In fact: Avoid IDs.
Problems
Bijection violation
You might reach the invalid ID sooner than your think
Don't use nulls for invalid IDs either
Coupling flags from caller to functions
Solutions
Mo...
maximilianocontieri.com2 min read
Gary McMeekin
Full Stack Cloud Developer
Isn't there a boolean-to-int conversion and that will result in a valid domain object of 0 (zero)? Maybe C handles this better than Javascript does.