3 ms·
Both those cases sound like code that was correct at the time of writing, with the assumptions at the time in mind. Which turned into incorrect code when the en
by diggan 3y ago
Both those cases sound like code that was correct at the time of writing, with the assumptions at the time in mind. Which turned into incorrect code when the environment changed, but that doesn't mean the code itself wasn't correct at the time, for the intended environment.
I guess I'd reserve "broken code" for code that doesn't work at all, I wouldn't use it to describe code that worked in one environment but not in another, unless purposefully built for the second of course.
- Someone 3y agoThat’s a very loose definition of “correct code”. If you write out of bounds or occasionally read memory you didn’t allocate and how do you know you get away with it, so that you can declare the code “correct”? Your program may crash only once in a thousand years. In my book it still would be incorrect as soon as it breaks the interface contract of the API, even if it never crashed or misbehaved. Also, in your definition, you can’t complain if a program stops running after even a tiny OS upgrade it wasn’t “purposely built for”, for example because it that didn’t exist yet at the time the program was compiled.