5 ms·
If you have the process quit it definitely stops them from being false though. I thought that was the point of assert()?
by JonnieCache 10y ago
If you have the process quit it definitely stops them from being false though. I thought that was the point of assert()?
- catnaroek 10y ago> If you have the process quit it definitely stops them from being false though. The assertion remains false for the final process state, before the process quits. Outside of the process, the assertion is simply meaningless (neither true nor false), because the assertion's free variables are only bound inside the process.
- coldtea 10y ago>The assertion remains false for the final process state, before the process quits. Which is inconsequential. Programmers don't expect automatic "recovery" from assertions, they expect them to notify them of the violated constraint, and/or to ensure that a program wont go on and use a value that violates an assertion further down -- which program termination achieves. >Outside of the process, the assertion is simply meaningless (neither true nor false), because the assertion's free variables are only bound inside the process. Captain Obvious?
- catnaroek 10y ago> Programmers don't expect automatic "recovery" from assertions, Users don't expect failed asserts at all. > Captain Obvious? Apparently not obvious enough for JonnieCache, who said: “If you have the process quit it definitely stops them from being false though.”
- coldtea 10y ago>Apparently not obvious enough for JonnieCache, who said: “If you have the process quit it definitely stops them from being false though.” He meant from being false subsequently in the program. I see we were joined by Technically Correct Man too. http://9gag.com/gag/a5PmrLq/technically-correct-man-the-man-we-need http://9gag.com/gag/a5PmrLq/technically-correct-man-the-man-...
- catnaroek 10y ago> He meant from being false subsequently in the program. But, you see, the assertion is no less false just because the process was aborted. The fact remains that there exists a reachable state for which the assert fails. So apparently what I meant is no more obvious to you than it was for JonnieCache.
- deleted 10y ago[deleted]
- coldtea 10y ago>But, you see, the assertion is no less false just because the process was aborted. The fact remains that there exists a reachable state for which the assert fails Yes, Captain Obvious, and that reachable state is exactly what every programmer who uses an assert() statement expects when he writes it. If there wasn't the potential for such a state, assert statements would do nothing ever in the first place -- so it would be kinda silly to even have them in.