logoalt Hacker News

SoftTalkeryesterday at 5:40 PM1 replyview on HN

Crashing (in the sense of "give up and exit with an error") on invalid inputs is valid (and often the best thing) in many cases.

Fix your inputs.


Replies

chowellsyesterday at 5:44 PM

I think you're using "crash" to mean "exit early". I am using "crash" in the sense of "this program did something causing the OS to terminate it externally". I suppose that's a real point of difficulty in communication across different programming languages.

We agree that the program should exit early. I think we agree it should do it cleanly and intentionally. I'm adding the constraint that "crash" doesn't necessarily mean "cleanly and intentionally", especially when talking about a C program.

show 2 replies