开发者

Interview question; what is the main theme of Effective C++? [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve 开发者_JAVA技巧this question? Update the question so it's on-topic for Stack Overflow.

Closed 9 years ago.

Improve this question

I was asked the following question at a recent job interview:

What do you think is the main theme / single word that sums up the Effective C++ series from Scott Meyers?

What would be your answer to this question?


In one word it's Advice


My answer would be "I'm not sure, I learned C++ without reading that book."


The two older editions gathered advice especially helpful for people switching from C to C++. Using new/delete instead of malloc()/free() and OOP was all new back in 1991.

The 3rd edition is more targeting people switching from other languages (Java, C# etc.) to C++. It comes with advice on patterns, templates, exception safety, a much richer standard library, and many other topics people didn't think about in 1991.

Basically, Scott Meyers' goal has always been to write "the best second C++ book to buy" - not something to teach you the language, but to become a real professional. He wanted to list the "50 most important pieces of advice for practicing C++".

Oh, and something we shouldn't forget: He wanted it (and succeeded in doing so) to be a technical book that's fun to read.


Although a very strange question to ask in an interview (considering your candidate might not have read such an excellent book), I would say the main theme of Effective C++ is to take the path of a semi-expert C++ programmer and adjust his/her way of thinking (especially towards the internals of C++) on the path of becoming an expert.

One thing I learned a lot about is self checking of references (Page 71, Item 17). Better memory management. Preferring new/delete vs malloc and free (which is obvious but his reasonining was very well stated). Another good one was Item 29 on page 123, avoid returning "handles" to internal data.

It is not a simple read, and it is definitely not a beginner's book. It's the next leap for a C++ programmer looking to become a better C++ programmer.

It was a very good book and although it's a little dated it is one of the best books to become a proficient C++ programmer. I still read portions of it to this day, and I'm definitely NOT a C++ expert; it's a hobby.

To impress the person interviewing you mention that although you liked Effective C++ that the interviewer should take a gander at More Effective C++. Explain some of the pros to this book as well and ask he/she if they too have read it considering they've read Effective C++. That should stump the chump :).


That C++ is an insanely complex language with lots of tricks, tips, idioms and odd constructions that you have to know by heart rather than being enforced by good language design?

Probably not going to get you the job at anywhere except MSFT though !


Don't

{blah body too short blah}


C++ gives you enough rope to hang yourself with. However, you can write solid code using it, if you follow these guidelines.


Guidelines to write better C++.


Main (plagiarized) theme: "With great power comes great responsibility"


How to write effective C++?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜