frollogaston 1 day ago

C++ is supposed to be an extension of C, so I wouldn't expect things to be initialized by default, even though personally I'm using C++ for things where it'd be nice.

I'm more annoyed that C++ has some way to default-zero-init but it's so confusing that you can accidentally do it wrong. There should be only one very clear way to do this, like you have to put "= 0" if you want an int member to init to 0. If you're still concerned about safety, enable warnings for uninitialized members.

2
dwattttt 1 day ago

C++ is supposed to be an extension of <thing with bad default>, so I wouldn't expect <a good default>.

Things can change & grow, that's why we make new standards in the first place.

frollogaston 1 day ago

It'd be confusing for C++ to differ from C in how primitives work. If they want to evolve C too then sure.

frollogaston 23 hours ago

also there are compiler warnings for uninitialized variables

gpderetta 1 day ago

my_type my_var = {}; almost always does the right thing.

The almost is unfortunate.