News for hackers. Stuff that matters.
Re:C Legacy Is Evil by yongjik on Friday November 07, 2014 @07:27PM (#8575435)
I'm sure Bjarne Stroustrup (and the C++ committee) had enough time and resource to mandate that structures are zero-initialized, if they were so inclined. (I mean, think about it: any time you read from an uninitialized value is an undefined behavior, so no conforming program will be broken by this change. Literally.)

The fact that they didn't tells me that this was a conscious decision, not some "Legacy C" cruft that's left there for the sake of backward compatibility. And indeed the core tenet of C++ is "You only pay for what you use", isn't it? Zero-initializing a struct would be against C++'s philosophy.

There are no comments on this comment yet.