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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Announcing the C++ FAQ

105 点作者 jlemoine大约 11 年前

8 条评论

AndrewBissell大约 11 年前
I recently started working my way through the C++ Primer after years of avoiding C++ and its reputation for complexity. My first impression is that it has actually matured into quite a nice language which strikes a balance between simplicity and programmer power which just isn&#x27;t all that bad, especially given its genesis.<p>There are some annoyances for sure -- lots of mentions of &quot;subtle&quot; differences in how certain concepts work are already cropping up in introductory chapters. I&#x27;m sure there&#x27;s some reason that &quot;auto&quot; discards top-level qualifiers while &quot;decltype&quot; does not, but trying to ingrain so many of those distinctions is a pain.<p>I&#x27;m also glad to have learned both Java and C before trying C++. The former so that I know some OO mistakes to avoid (I would <i>not</i> want to discover the pain of over-enthusiastic use of generics while knee deep in compiler template errors), and the latter because learning manual memory management and the stack&#x2F;heap distinction is enough of a cognitive load without layering all of C++&#x27;s extra features on top. It&#x27;s also good to have a bit deeper understanding of what&#x27;s <i>really</i> going on with the memory and pointers under the hood, before handing over control to automatic resource management and smart pointers and such.
评论 #7452162 未加载
评论 #7451848 未加载
评论 #7451917 未加载
acc01大约 11 年前
An essential companion to the consolidated C++ FAQ is the indispensable C++ FQA.<p><a href="http://yosefk.com/c++fqa/" rel="nofollow">http:&#x2F;&#x2F;yosefk.com&#x2F;c++fqa&#x2F;</a>
评论 #7451428 未加载
评论 #7452200 未加载
评论 #7451387 未加载
评论 #7452184 未加载
balls187大约 11 年前
Communities like Node, Python, RoR, and even iOS (obj-c) have benefited from a defacto centralized point of reference, and I think devs who come from those communities will find it easier to be more productive in C++ with something like this.<p>I always referred to Marshall Cline&#x27;s FAQ as my reference point, but pulling together Bjarne&#x27;s and StackOverflows FAQ&#x27;s is a great step.
brudgers大约 11 年前
<p><pre><code> Until now, there have been several different overlapping FAQs, including notably: Bjarne Stroustrup’s FAQ pages Marshall Cline’s popular C++ FAQs Online at least three different StackOverflow C++ FAQs in some form.... and many others </code></pre> What could be more apropos than multiple inheritance?
评论 #7454010 未加载
shmerl大约 11 年前
Marshall Cline’s C++ FAQ is really great. Good to see it will be merged into the new one.<p>Other resources I use regularly are:<p>* <a href="http://en.cppreference.com" rel="nofollow">http:&#x2F;&#x2F;en.cppreference.com</a><p>* <a href="http://www.cplusplus.com" rel="nofollow">http:&#x2F;&#x2F;www.cplusplus.com</a>
omaranto大约 11 年前
I enjoyed the wording of this question: &quot;I’m from Missouri. Can you give me a simple reason why virtual functions (dynamic binding, dynamic polymorphism) and templates (static polymorphism) make a big difference?&quot;
elnate大约 11 年前
Did anyone else think of the XKCD comic on new standards?<p><a href="https://xkcd.com/927/" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;927&#x2F;</a>
评论 #7451664 未加载
e12e大约 11 年前
I found the link to Stroustrup&#x27;s &quot;Learning Standard C++ as a New Language&quot; [edit: from 1998, which explains why I found it kind of familiar to my late 90s run-in with c++...] interesting[2,1]. But then I tried to find out what&#x27;s the current state of the art for idiomatic, cross-platform text processing (in unicode, probably utf-8) -- and got a little sad.<p>There&#x27;s still no way to write a ten(ish) line c++ program that reads and writes text, that works both on the windows console, and under OS X&#x2F;*bsd and Linux?<p>(Lets go crazy, say you have to implement a minimal cat, tac (reverses stdin on stdout) -- and also corresponding echo and ohce (I made that up, something that takes string(s) as input, and outputs the characters reversed (ie: &quot;ohce olé there&quot; outputs &quot;ereht élo&quot;).<p>[2][edit] The direct link to Strostrup&#x27;s paper is:<p><a href="http://stroustrup.com/new_learning.pdf" rel="nofollow">http:&#x2F;&#x2F;stroustrup.com&#x2F;new_learning.pdf</a><p>code:<p><a href="http://isocpp.org/wiki/faq/newbie#simple-program" rel="nofollow">http:&#x2F;&#x2F;isocpp.org&#x2F;wiki&#x2F;faq&#x2F;newbie#simple-program</a><p>[1]<p>The FAQ briefly touches on Unicode, but it doesn&#x27;t seem very helpful (to me): <a href="http://isocpp.org/wiki/faq/cpp11-language-misc" rel="nofollow">http:&#x2F;&#x2F;isocpp.org&#x2F;wiki&#x2F;faq&#x2F;cpp11-language-misc</a> (search page for unicode)<p>Trying to look for a (simple, generally accepted) solution, I came across:<p><a href="http://www.utf8everywhere.org/" rel="nofollow">http:&#x2F;&#x2F;www.utf8everywhere.org&#x2F;</a> (If I&#x27;m reading this right, it says assume std::string is utf8, but I&#x27;m not sure if there are std-lib funtions for doing stuff like getting the index of a glyph, and reversing strings by glyph? And will they work on windows?)<p><a href="http://stackoverflow.com/questions/2037765/what-is-the-optimal-multiplatform-way-of-dealing-with-unicode-strings-under-c" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;2037765&#x2F;what-is-the-optim...</a><p>Which points to: <a href="http://utfcpp.sourceforge.net/" rel="nofollow">http:&#x2F;&#x2F;utfcpp.sourceforge.net&#x2F;</a> which is the best I&#x27;m aware of so far.<p><a href="http://stackoverflow.com/questions/8513249/handling-utf-8-in-c" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;8513249&#x2F;handling-utf-8-in...</a><p><a href="http://stackoverflow.com/questions/402283/stdwstring-vs-stdstring" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;402283&#x2F;stdwstring-vs-stds...</a><p>(Suggest using wstring on Windows and string on Linux -- for simple programs that would effectively mean write to versions, one for each platform ..)
评论 #7452936 未加载
评论 #7455709 未加载
评论 #7452274 未加载
评论 #7452470 未加载
评论 #7452286 未加载