logoalt Hacker News

rixed • today at 8:50 PM • 2 replies • view on HN

Going on a tangent, but I'm always owndering if "modern C++" sounds rather appealing or off-putting to most people?


Replies

moltopoco • today at 10:12 PM

Just one data point, because I have to get it off my heart. I loved Modern C++ when it meant C++11, but I've become more negative with each new language standard reaching my workplace.

Using string_view over string by default is probably the #1 cause of memory errors that landed on my desk. I also keep hearing that "int x{0}" is preferable to "int x = 0" which allows for super dangerous implicit conversions, but then the same people rewrite push_back into emplace_back, which is much more lenient w.r.t. type conversions. It is also much easier to litter every function with [[nodiscard]] constexpr nothrow than it is to argue for readability.

My best explanation is that "Modern C++" is making developers biased towards whatever language feature is newer, instead of making good decisions. I wish the community gave up on the moniker.

omoikane • today at 9:16 PM

Maybe they are referring to Effective Modern C++ book by Scott Meyers.

I think "modern" is used to contrast newer C++ standards from C++98.

➕ show 1 reply