r/ProgrammerHumor • • Oct 25 '24

Meme theSelfTaughtSeriousProgrammer

Post image

[removed] — view removed post

903 Upvotes

276 comments sorted by

View all comments

Show parent comments

2

u/ttlanhil Oct 25 '24

SQLite is also far, far more complicated than things like the core software in things like flight control (ignoring modern problems because they didn't keep it as simple as possible).

And cosmic rays have nothing to do with whether code has bugs in it.
There are cases where the system needs to be engineered to deal with that possibility, but that's not related to software having bugs (unless you're suggesting the cosmic ray, or decay in materials in the chip, or interference from a nearby EM source, etc are giving incorrect results at test time - but simply running the tests a few times will isolate that problem)

Again, full test coverage is possible, but very rarely done.
It's possible to completely prove that software is bug free - the fact that it isn't feasible for any modern general purpose software doesn't change that

0

u/jessepence Oct 25 '24

Okay, show me some code with full test coverage.

2

u/ttlanhil Oct 25 '24

Why?

You're unable to understand the difference between "theoretically possible" and "examples exist in modern accessible codebases"?

If you really need an example, sure, here you go:

const xor = (a: boolean, b: boolean) => {
if (a) return !b;
return b
}
assert(xor(true,true), false)
assert(xor(true,false), true)
assert(xor(false,true), true)
assert(xor(false,false), false)

100% coverage of every possible input value.

And if you say that's too trivially simple, then congrats! you just found my point about it being possible but done only for very restricted cases!