3 ms·
Edit: Rewritten. You say, "Oh, please." But this feature is consistent with the design mandate of the C++ language... the very foundation of its design is that
by klodolph 8y ago
Edit: Rewritten.
You say, "Oh, please." But this feature is consistent with the design mandate of the C++ language... the very foundation of its design is that you don't pay for safety if you don't want to. So I am not sure what you are trying to say.
Honestly... why aren't you just using a different language? Practically every other language invented in the past 30 years has the safety features it sounds like you want. So, why come into a discussion about some new C++ feature and complain about the fact that a safety feature is optional? This is the way it always has been for C++. This is the way pointer dereferencing works for all the new smart pointers. Dereferencing std::shared_ptr and std::unique_ptr... both unsafe, equally unsafe as std::optional. This is the way std::vector works. They're all unsafe unless you specifically use certain safer accessors like .at(). The fact that dereferencing a std::optional is unsafe is consistent with decades of changes to C++.
- Stratoscope 8y agoLet's keep things civil please. Saying "I can only imagine that you're trying to start a fight" is rarely helpful.
- klodolph 8y agoOkay, rewritten. I honestly thought the parent comment was baiting, since complaining about C++ safety is... well, rarely helpful and usually just starts arguments.
- Stratoscope 8y agoThank you for the rewrite, much appreciated. If I may offer a tip, when someone takes a position that seems unreasonable or baiting or argument-prone, I try to apply the principle of charity: I assume that their intentions are good. Of course I don't always succeed at this! ;-)
- klodolph 8y agoSometimes the principle of charity is quite harsh, because in some cases if you assume that someone has good intentions, you come across as condescending and make it sound like you think they're ignorant. So I don't think that the principle of charity is always the right approach. The tone of the original comment starting with "Oh please" doesn't incline me towards a charitable interpretation, and it still doesn't.
- Stratoscope 8y agoYou are certainly right about that. Perhaps this is where it becomes an art instead of a science. How can we create a positive conversation that we can all learn from, even when people say such obviously provocative things as "Oh please"? If someone takes that kind of attitude, so what? You'll never lose by taking the high road; I've found it to be a very rewarding exercise to try to be chill regardless. Of course as I mentioned, I don't always succeed. At least I try to be like the old Shadio Rack: "You've got answers? We've got questions."
- klodolph 8y agoEmphatically disagree. You can lose by taking the high road, because it costs time and energy. Being chill regardless is an unhealthy habit, I've found it better to allow myself to feel whatever I happen to be feeling (mindfulness), and share my feelings with others when appropriate. This will inevitably be "not chill" from time to time but it's healthier.
- mlvljr 8y agoCheck who the author is though
- deleted 8y ago[deleted]
- blub 8y agoI can see that the standard committee is taking some steps to make things safer and I would really appreciate a C++ safety profile, where one can choose if they want the STL UB or not. E.g: GCC 7.x has a macro which makes all these unsafe member functions abort instead of exhibit UB. Even better would be a "safe" block like D, where everything is checked & well defined.