HACKER Q&A
📣 amichail

Is it wrong to release an app with assertions everywhere in the code?


Assume that the these assertions have negligible impact on performance but can cause the app to crash.


  👤 superchroma Accepted Answer ✓
So, in brief: "Is it wrong to release an app ...[with code]... that will cause it to crash"

Uh, well "wrong" is a morality judgement, which is subjective. It could be said to be less than optimal. It may well be wrong by your users, but you'd have to survey them yourself.

You should try and fix bugs you know exist before you launch, unless you decide their severity (ease of repro, impact (is it a CtD, recoverable bug, visual defect, etc.), etc.) is acceptable. In the event you launch with known bugs, the responsible thing to do is to clearly document them so users can know what to expect. All software has unknown bugs in it, but if you know they're there, you probably should address them in some way.


👤 bjourne
Keep assertions on even in production unless you have compelling arguments for the opposite. E.g. people might die if the process terminates.

👤 brudgers
Malicious intent aside, there is nothing wrong with releasing.

👤 joshxyz
in javascript i do assertions in my parameters on each function, this is to ensure correctness in dev and prod.