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

This pattern is known in numerical computing as NaN. It’s drawback is that when the computation produces NaN, one has no idea what triggered it. But that can be mitigated if the program prints stack trace on the first NaN. In case of Go that corresponds to logging error when it happens.

Another thing is that in many cases there is no good sentinel value to return that naturally leads to exit from loops or complex logic to check for error at the end of a function.




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

Search: