3 ms·
> All that really matters is that we initialize it to something. People make mistakes and forget to do this and their program sometimes goes wrong in an unpred
by chrisseaton 4y ago
> All that really matters is that we initialize it to something.
People make mistakes and forget to do this and their program sometimes goes wrong in an unpredictable way. Maybe only going wrong when in production. It’s redundancy - most other fields of engineering do it, we seem to think it’s weird in CS.
- wirrbel 4y agoI think the most annoying part about errors due to missing initialisation is that (especially with variables on the stack, so not those allocated with Malloc) they are coincidentally pre-filled with values from the functions that were called immediately before the current function. So instead of completely random behaviour you see somewhat random behaviour. And an off by 5 error is a lot harder to track than a off by several thousands error.