5 ms·
For learning the best principles about actually driving (aka coding) in C++, what are the best resources these days? I learned from Stroustrup, Accelerated C++,
by banachtarski 13y ago
For learning the best principles about actually driving (aka coding) in C++, what are the best resources these days? I learned from Stroustrup, Accelerated C++, and on the job programming. However, every company seems to have an idea of what "good C++" looks like and they all disable/enable a varying subset of C++ features to support their individual standards.
What's the closest guide out there that's representative of "ideal" C++ code and style?
- rikthevik 13y agoThere is none! It's totally dependent on the project, the people involved and the tools being used.
- seanmcdirmid 13y agoStop and consider if you really need to be programming in C++; if not, don't do it. If you do, then focus on problem domain (embedded, gaming, OS, low-level stuff, ...) you need C++ for rather than C++ coding in isolation.
- eliasmacpherson 13y agoI think this is wise. On a one man team, assigned a task of 'just get it done', I can think of better languages than C++ for most tasks. I think a general awareness of C++ is good, so that when joining a team you can learn their corner of C++. Whereas spending your own time learning all corners of it is bad, because a lot of that time could be wasted, unless it's an enjoyable way to spend time for that given person.
- banachtarski 13y agoIn the games world, C++ is still ubiquitous as it is one of the few places where bleeding edge performance is a competitive advantage. In my case, I want to write my own game engine :). I've been using other engines for years and have plenty of experience in other languages (Haskell, Ruby, Python, Lisp, Erlang, etc). Although I have a lot of C++ experience, I feel like the idioms sometimes allude me.
- eliasmacpherson 13y agoI guess the most sensible thing to do is then ape the style of whatever libraries you intend on using the most!
- deleted 13y ago[deleted]
- zanny 13y agoEven between Sutter, Stroustrop, and Alexandrescu you will find completely different approaches and styles. Use what makes sense to you, and by makes sense to you, I mean you know exactly what you are doing, if you are starting or managing a project. If you aren't the lead, follow the leader, unless they have some glaring issues in their style and technique. This happens most of the time, though, because C++ is a huge beast.
- alayne 13y agoI think looking at a popular open source project in C++ like LLVM may prove valuable http://llvm.org/docs/CodingStandards.html http://llvm.org/docs/CodingStandards.html. Google has a C++ style guide http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml http://google-styleguide.googlecode.com/svn/trunk/cppguide.x.... I could see a C++ project with many people being difficult without some basic guidelines. Sometimes style guidelines are less about the "best" way and more about consistency for people to be able to work with code they didn't write.