logoalt Hacker News

etermyesterday at 5:36 PM1 replyview on HN

Better yet, `assert(false, message)`, with the message what you would have written in the comment.


Replies

addaonyesterday at 5:38 PM

`assert(false)` is pronounced "this can never happen." It's reasonable to add a comment with /why/ this can never happen, but if that's all the comment would have said, a message adds no value.

show 2 replies