top | item 39678667

(no title)

jvillasante | 2 years ago

While other communities are already taking direct steps towards safety, the C++ community is still trying to define what safety means. I think it's funny and sad at the same time!

I didn't read the article (just browse it) but here's the TLDR from the article itself:

``` tl;dr: I don’t want C++ to limit what I can express efficiently. I just want C++ to let me enforce our already-well-known safety rules and best practices by default, and make me opt out explicitly if that’s what I want. Then I can still use fully modern C++… just nicer. ```

As is normal in C++, the defaults are wrong. Developers should "opt in" for unsafe instead of "opt out" of it!

discuss

order

soulbadguy|2 years ago

> Developers should "opt in" for unsafe instead of "opt out" of it!

Why ? C++ guiding principle is zero cost abstractions.

estebank|2 years ago

It's "zero cost abstractions over what you would write by hand". If you argue that anyone doing array access should be doing bounds checks when in doubt, a C++ compiler performing bounds checks would still be considered zero(additional)-cost.

spacechild1|1 year ago

> As is normal in C++, the defaults are wrong. Developers should "opt in" for unsafe instead of "opt out" of it!

Isn't this exactly what he is saying?