TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Here's a C++ Conspiracy Theory for You

1 点作者 funny_falcon超过 1 年前

1 comment

eesmith超过 1 年前
It&#x27;s a video where the speaker says the conspiracy theory, while the video shows irrelevant gameplay.<p>The argument starts with the thesis that &quot;you should use modern C++ everywhere&quot; is generally meant to mean &quot;you should use value semantics everywhere.&quot;<p>This is odd to me since my C++ experience is from the 1990s when &quot;you should use modern C++ everywhere&quot; often meant &quot;use string instead of char *&quot; and &quot;use new instead of malloc&quot;. I see the emphasis on using value semantics as being a delta on top of the older meaning, where the old meaning still exist, but the speaker just naturally assumes them to be correct.<p>I don&#x27;t have much experience with modern C++ but I thought the speaker&#x27;s complaints about &quot;this begin() and end() everywhere&quot; has been (mostly?) resolved with range-based for loops added in C++11 and various improvements since then, and the complaint about string split has been resolved with std::ranges::views::split in C++20, like the example at <a href="https:&#x2F;&#x2F;en.cppreference.com&#x2F;w&#x2F;cpp&#x2F;ranges&#x2F;split_view" rel="nofollow">https:&#x2F;&#x2F;en.cppreference.com&#x2F;w&#x2F;cpp&#x2F;ranges&#x2F;split_view</a> .<p>Which makes it sound like those issues can be resolved by ... using modern C++ everywhere.<p>The author correctly highlights how some standard library components have faster equivalents elsewhere, concluding &quot;so they provide the STL for you and it&#x27;s a piece of crap, right? But you have to use it because it&#x27;s the modern way to do thing.&quot;<p>Thing is, the author already pointed to Boost as a faster alternative for map, for example. Using modern C++ does not mean only using the STL.<p>The author seems to think that people using Boost are generally considered dinosaurs. Which doesn&#x27;t fit my understanding.<p>I stopped listening about 5 minutes in when the author said the concepts behind the movement to use modern C++ are &quot;virtue signalling&quot;. It&#x27;s a culture war term that has no real useful meaning here, and a far more appropriate term is &quot;shibboleth&quot;.