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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why C++ Sails When the Vasa Sank [pdf]

112 点作者 dirtyaura将近 11 年前

15 条评论

AnimalMuppet将近 11 年前
To me, the key line was &quot;Most of the complexity of C++ is hidden from most of the users most of the time.&quot;<p>The complexity is there. Trying to understand the whole language at a language-lawyer level is mind-boggling. Trying to write libraries that make proper use of the goodies is very hard.<p>But using C++ isn&#x27;t so bad, as long as you don&#x27;t try to use every aspect of it. Just use the parts you need to be able to do what you&#x27;re really trying to do. You don&#x27;t have to pay for what you don&#x27;t use. That&#x27;s good enough for a huge number of programmers in a wide variety of contexts.<p>There&#x27;s a lot of haters that can point out a huge number of flaws. But here&#x27;s the thing: Most of them, I never run into. I don&#x27;t care if the move syntax is confusing; I don&#x27;t use it. Maybe I never will. If I have to, <i>then</i> I&#x27;ll care about how good or bad the syntax is. In the meantime, the parts I actually use let me get my work done better than any alternatives.
评论 #7934912 未加载
评论 #7934905 未加载
评论 #7934907 未加载
评论 #7936003 未加载
评论 #7935086 未加载
评论 #7935787 未加载
评论 #7935446 未加载
Tomte将近 11 年前
When in Stockholm, go visit the Vasa museum. It&#x27;s absolutely breathtaking.<p>Make sure to get a guided tour. You can read all the stuff on the displays and in books, but you probably won&#x27;t. So you&#x27;d lose all those nice stories about how the German ambassador protested the ship, because the figurines on the front symbolized the Roman emperors, with the Swedish king at the very front. Preposterous! The emperor of the Holy Roman Empire of the <i>German</i> Nation is the rightful successor to the Roman emperors, after all!<p>Pay attention to the fact that the Swedes weren&#x27;t as stupid as people tend to assume. &quot;Oh, they couldn&#x27;t even build a ship that&#x27;s floating!&quot;.<p>Yeah well, it was a design no-one had attempted before (bigger, three masts, two rows of cannons), the math to calculate the behaviour wasn&#x27;t available, yet. And best of all -- contemporary analysis shows that they almost made it. Had the ship been just a little bit wider (I don&#x27;t know, something like 20 centimeters or so?), it would have been fine.<p>Be amazed how the Swedes never just found a scapegoat to punish for the loss of their flagship.<p>Or just admire the architecture of the museum.<p>Whenever I&#x27;m in Stockholm I go there. It&#x27;s inevitably a high point of my visits.
评论 #7938089 未加载
评论 #7938154 未加载
评论 #7939913 未加载
评论 #7938352 未加载
4bpp将近 11 年前
The way people like to complain about the bloat and arbitrariness of C++, but then still quietly wind up using it, reminds me a lot of the common complaints about the arbitrary pronunciation and other quirks of the English language. There is, of course, the trivial commonality that &quot;everyone understands it and a lot of useful things have already been written in it&quot;, but at least part of the reason why languages like Esperanto or even Lojban don&#x27;t catch on is that while many like to extol the virtues of a (natural or machine) language being simple and unambiguous on paper, in practice, more often than not people arrive at a point where they perceive the very un-Pythonic benefit of being able to express the same thing in more than one way (and, conversely, being able to convey more than what the words&#x2F;code say at face value).<p>The natural language example of course being metaphor and allusion, I am thinking of practices such as indenting glVertex calls inside a glBegin&#x2F;glEnd block, or overloading () on an object to convey the idea that &quot;you should think of this as something like a function&quot; when it is really not on a technical level.
评论 #7935669 未加载
评论 #7936212 未加载
评论 #7936435 未加载
cacainmycafe将近 11 年前
I like C++ because I only pay for what I use in the language. Very little overhead or additional baggage to slow or weigh things down, unless, I elect to include the extra luggage.<p>The recent updates - C++11, C++14 and the drafts for C++17 are also very welcome.<p>When you need performant, deterministic, portable and testable code, you go for C++.
评论 #7934808 未加载
ingve将近 11 年前
The video:<p><a href="http://tech.yandex.ru/events/cpp-party/june-msk/talks/1954/" rel="nofollow">http:&#x2F;&#x2F;tech.yandex.ru&#x2F;events&#x2F;cpp-party&#x2F;june-msk&#x2F;talks&#x2F;1954&#x2F;</a>
评论 #7935016 未加载
评论 #7935187 未加载
alexvr将近 11 年前
I think its &quot;excessive&quot; features make it an appealing language so long as I&#x27;m not dealing with not-so-well-written and&#x2F;or expertly &quot;clever&quot; code.<p>I find straightforward, well-written C++ more comprehensible than Java and even Python (only due to Python&#x27;s dynamic typing).<p>Of course, the definition behind straightforward, well-written C++ is very subjective.
thrownaway2424将近 11 年前
<p><pre><code> auto y = std::move(x); </code></pre> Is this good code? How do you review it? What&#x27;s the type of y? Usually I would ask for at least one type statement per line. For example this seems ok to me, because the type is on the left.<p><pre><code> auto* x = new Foo(); </code></pre> But this doesn&#x27;t seem ok:<p><pre><code> auto y = std::move(x);</code></pre>
评论 #7934827 未加载
评论 #7934835 未加载
评论 #7934825 未加载
评论 #7935085 未加载
评论 #7935100 未加载
评论 #7934925 未加载
评论 #7934736 未加载
评论 #7934903 未加载
评论 #7934721 未加载
eatitraw将近 11 年前
Scott did an amazing talk in Moscow two weeks ago. The slides look the same. Here is the link to the video:<p><a href="http://tech.yandex.ru/events/cpp-party/june-msk/talks/1954/" rel="nofollow">http:&#x2F;&#x2F;tech.yandex.ru&#x2F;events&#x2F;cpp-party&#x2F;june-msk&#x2F;talks&#x2F;1954&#x2F;</a>
vasilipupkin将近 11 年前
I&#x27;ve been using C++ for many years, and, sure, it has a ton of various features, not all of which I use all of the time. But, being comfortable with it, I don&#x27;t find it any harder to program in than Java or Python. I am not sure if it&#x27;s fair to say that the learning curve is higher to get to that point. But then again, if you do silly things in Java, won&#x27;t your code be slow as well?
vilya将近 11 年前
The line that stood out to me was the quote from Stepanov, about C++ being the only language in which it was possible to implement the STL. To most people, that would have been a hint that perhaps the design of the STL was flawed...<p>I think the STL may have been the worst thing to have happened to C++. It could have been so much nicer if something like Qt (the core part) was adopted instead.
评论 #7937453 未加载
评论 #7937045 未加载
lutorm将近 11 年前
Why does the title slide show a ship flying a US flag? He obviously has correct pictures, because they are in the later slides...
评论 #7935059 未加载
评论 #7935047 未加载
jokoon将近 11 年前
there are still things I wish would be possible for c++. I&#x27;m not a language expert, but I still wish for those things.<p>* non templated tuples instead of struct: for example, 2 struct types are the same if the data types they hold is the same. Not sure if it&#x27;s possible for statically typed language.<p>* tighter STL container integration with the core language syntax<p>* some way to do modules<p>* some new thing to make compiling much faster, so to avoid relying on precompiled headers. go and rust are so much faster for this, C++ is not. I still wonder if there could be some gcc or clang extension for this, it would be really appreciated. C++ is awesone to work with, but language implementations suffers from those little details.
评论 #7935697 未加载
评论 #7935120 未加载
评论 #7935354 未加载
santaclaus将近 11 年前
Why can&#x27;t we simply have C + RAII + generics? That would be a baller language.
评论 #7936412 未加载
detrino将近 11 年前
I really enjoyed this talk. The Q&amp;A session was great as well, Scott is an entertaining story teller.
Moral_将近 11 年前
Why do people insist on linking to slideshare? <a href="http://files.meetup.com/1455470/Why%20C%2B%2B%20Sails%20When%20the%20Vasa%20Sank.pdf" rel="nofollow">http:&#x2F;&#x2F;files.meetup.com&#x2F;1455470&#x2F;Why%20C%2B%2B%20Sails%20When...</a>
评论 #7934910 未加载