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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: What did you do to become an expert in C++?

8 点作者 yr大约 14 年前
How did you master C++ language ?

10 条评论

Animus7大约 14 年前
It just takes time. 10K hours or whatnot. I've been writing C++ almost every day for the last 10 years, and I'm still learning.<p>My best advice would be to just do it. Don't focus on memorizing the syntax of pointer-to-member functions or the stupidly complicated overload rules. C++ is powerful but a lot of it is quite useless in practice.<p>Instead, you should be writing DNS servers, hiding text as bit patterns in JPEGs, or whatever other thing you find intellectually interesting. Sprinkle in some Google and bake for a few years.<p>I'm sorry to say that like with most things in life, there aren't any shortcuts here.
makecheck大约 14 年前
It's important to distinguish C++ expertise from that of other languages. C++ is so large (and with C++0x will be larger still) that any expert you do meet will know at best a large portion of some subset of the language. And this is fine.<p>The most important skill is general problem solving, and for this a variety of tools is helpful. So in the C++ world, focus on a few language features that are most different from one another. Make sure you know <i>basically</i> how templates work, but don't fret if you've never seen a specialization or any of the 44 corner cases that are unsupported or undefined. Learn at least common STL containers like vectors, sets and maps, and learn basic_string. Expose yourself to at least one algorithm like fill_n(), and recognize how it is different for vectors versus C arrays. Learn ostringstream. Use namespaces, and learn about the "using" keyword. Learn the basics of classes, constructors and destructors, and the RAII technique. Master all of this before exploring the messes that are inheritance and exception handling.
queensnake大约 14 年前
Read the Exceptional C++ series (shorter, 'highlights' version is C++ Coding Standards), Modern C++ Design, and Andrei Alexandrescu's unpublished columns.
评论 #2430240 未加载
turbojerry大约 14 年前
As many have said here, it's about actually writing code in the end, personally I learned C++ by writing an electronic schematic editor as a front end to a SPICE circuit simulator, so I learned C++ and the Windows API at the same time. Of course as well as writing code, reading other peoples is useful too, when i was learning there weren't the reasources there are today, you can go over to github or sourceforge and find lots of interesting code to learn from, and do code reviews on to see how you might have done things differently.
elmindreda大约 14 年前
You don't master it, so instead I will write about what I did to learn reasonable amounts of it.<p>I wrote lots of code, tried use it and then fed what I learnt back into the design. Repeatedly.<p>I read tons of other people's code. Large, running projects. Example code won't work.<p>Occasionally, I read books, but the only one I ever read all the way through was /Teach Yourself C++ in 21 Days/ back in 1996 (and its title is ridiculous; I'm still learning every day).
nostrademons大约 14 年前
(Not an expert, but reasonably proficient.)<p>I worked with a lot of really good C++ programmers and had them do my code reviews. The best way to learn is to expose yourself to people who know more than you do and give you feedback.<p>As one of my coworkers is fond of saying, "If you work with people better than yourself, you'll get better. It just happens naturally."
SamReidHughes大约 14 年前
Assuming that I <i>have</i> mastered it, it happened from learning and using Haskell, watching people post and smart people answer in some C++ megathread, and getting a job where the product is written in C++. And also some early experience using it in a CS II class that used Koenig &#38; Moo.
sambeau大约 14 年前
The answer is the same as it is for any programming language: write something big.<p>You can read as much as you want but it will never make you an expert. To fully understand a language you have to live in it for a while.
badkins大约 14 年前
My first real project was writing a game engine, and then using it to write a couple games. After that, I learned a whole lot writing a compiler for a C like language.
known大约 14 年前
I wrote a proprietary trading system in C++.