3 ms·
I think it's not an apples to apples comparison. In mathematics, there are abstract concepts like integers. For any i, i+1 is also an integer. In programming,
by Maro 9y ago
I think it's not an apples to apples comparison.
In mathematics, there are abstract concepts like integers. For any i, i+1 is also an integer.
In programming, there is a MIN_INT and MAX_INT. If you write i/2, it's different than i/2.0. If you store a long string in a database, the column may be cut off at 32 chars because of the column type. Running string algorithms that sounds perfectly reasonable on ASCII may result in weird outcomes on Unicode. Most of these things also depend on the programming language, the compiler (MS, gnu, etc), the compiler version, OS, libraries, sometimes even the locale! A provably good crypto algorithm may be vulnerable to side-channel attacks. A mathematician may be happy to give an existential proof, but a programmer needs an implementation, and one that is polynomial [usually]. And so on...
The tldr is, the real world is more complicated, limited and nuanced than the abstract concepts of mathematics.