| ▲ | layer8 an hour ago | |
Arguably it’s only unnecessary when the value range is enforced by the programming language (types). The structure of who calls what in the code can change, and suddenly larger values can appear. You don’t want to have to perform whole-program analysis on every change to check whether all assumptions made in the past still hold. That’s also a source of vulnerabilities: assumptions that held when the code was written, but stopped holding sometime later. That’s why I think code needs to document all its assumptions, and in a way that is checked by the compiler to the extent possible. If you document that the values have restricted range, then the AI should be taking it into account. | ||
| ▲ | eithed an hour ago | parent [-] | |
Types is an option. Another option would be tests (and in this case mutation testing). My main point still stands = LLMs code defensively catering for unknowns that are not loaded into context. | ||