Hacker News new | ask | show | jobs
by dathinab 1602 days ago
The scary thing is:

Handling uninitialized memory is hard in C++ (and C), too.

You just don't notice and accidentally do it slightly wrong (mainly in C++, in C it's harder to mess up).

1 comments

Exactly this. And also avoiding initializing memory with zeroes or something is often premature optimization. Very few programs are performant enough to notice the difference.
In my experience the most common use case for zero-memset is not optimizations but to reduce fallout if you happen to initialize a field..., like a newly added field.