Reddit Reddit reviews C++ Coding Standards: 101 Rules, Guidelines, and Best Practices

We found 11 Reddit comments about C++ Coding Standards: 101 Rules, Guidelines, and Best Practices. Here are the top ones, ranked by their Reddit score.

Computers & Technology
Books
Computer Programming
Microsoft C & C++ Windows Programming
Microsoft Programming
C++ Coding Standards: 101 Rules, Guidelines, and Best Practices
Check price on Amazon

11 Reddit comments about C++ Coding Standards: 101 Rules, Guidelines, and Best Practices:

u/ZMeson · 11 pointsr/programming

Read Rule #0 from C++ Coding Standards: Don't Sweat the Small Stuff.

Basically, it's the same advice /u/akciom gave (but hey -- it's good to have a reference by some experts in the field): Just be consistent within your project. Fretting and/or arguing over style is a waste of time. Afterall style is 'small stuff'. (Things like const correctness on the other hand are not small; good advice on these things for C can be easily found on the internet.)

u/unknownmat · 4 pointsr/java

> if this is the worst of things he won't change on consider yourself lucky; there are loads of teams out there dealing with much worse

Agree with this response. I think it's telling that in Coding Standards the very first section is titled "Don't Sweat The Small Stuff". Professional developers should be able to read and understand a wide variety of conventions.

Developers have a bizarre ability to argue forever about trivial things like curly brace placement and naming conventions.

u/eco_was_taken · 3 pointsr/gamedev

Good advice. I would add both the C++ FAQ Lite and the C++ FQA Lite to the resources.

I also rather enjoyed C++ Coding Standards by Andre Alexandrescu (who seems to be Walter Bright's right hand man working on D) and Herb Sutter (who used to chair the C++ standard committee and is known of the GOTW articles).

u/protein_bricks_4_all · 3 pointsr/learnprogramming

There's OO design, and there's particulars as to how to implement things in C++. I'm totally with unapersson as to, that the Os you make are as often conveniences or design helpers as representing real world objects. Ie that it's implementation objects. I don't remember how much OO design advice Effective C++ has, but it's a good book to get someone to intermediate C++ programmer. C++ Coding Standards by Herb Sutter and Andrei Alexandrescu talks at a fast clip about a lot of taste and design issues; I haven't looked at the 3rd edition of Eff. C++ but, from earlier editions, the difference is that Coding Standards is more dense, and sophisticated; Eff. C++ more basic (from what I can see, Coding Standards does cover the same material as Eff C++, but in a very compressed form, only the most minimal discussion; maybe not what you want when you're seeing the material for the first time.

As for pure OO design, I've heard that straight-up Grady Booch is still the best, but I have no experience of it.

I will say, if you want to be good at C++, you'll have to spend money on books (but get your company to buy them perhaps - compared to programmer time, books are free), and time on reading them; there are a lot of best-practices, technicalities and real pitfalls that are not immediately obvious.

edit:

> Also, should I be studying data structures/algorithms in unison with OOP?

Definitely. Have you learned the basics, stack, tree, queue, hash tables (or set, map, vector, unordered_set, unordered_map)? You /must/ know these. (priority_queue and list too, less so maybe.) If you can though I'd read (somehow) about other data structures, spatial ones especially in your case; they can really make your program more efficient and thus able to do more.

edit edit:

I have to say, the above books are for long-lasting code; probably for games your best bet is to look at how other programmers write their games (smaller, simpler, even in other languages - it can be hard to understand large, sophisticated codebases) and, just the necessary experience you gain from writing your own.

u/I_Am_King_James · 2 pointsr/cpp_questions

There are lots of public coding standards which attempt to codify this. They are typically fairly opinionated, but they do have lots of tips:

u/haohaolee · 2 pointsr/cpp

hmm, do you know something about RAII? If not, go searching for that. And, I think all excellent C++ books would mention that, like this and this

u/last_useful_man · 2 pointsr/learnprogramming

I have to say linux profiling has seemed to me to be a fast-moving target, meaning you'll get scattered results if you search. But, there's this which seems up-to-date: http://en.wikipedia.org/wiki/Perf_%28Linux%29

Then there's Ulrich Drepper's 'What every programmer should know about memory' (long series, but worth skimming at least, if your code is memory intensive. At least read about cache-coherency and cache-lines): http://lwn.net/Articles/250967

But the biggest thing is to get the algorithms right. Sounds like you want image-processing books. Also, GPUs are just absolutely the right place to do this stuff, and there are probably libraries already out there for it; speaking of which, did you know about OpenCV? It even has some stuff implemented on the GPU (as CUDA). I root for OpenCL, but the fact is, almost everything out there, libraries, and books, is written for CUDA.

> All the software is written in C++: I am interested in unlearning bad habits and writing better and easier to maintain code.

I suggest Effective C++ if you haven't read it yet. Also, Herb Sutter's 'Exceptional C++' series (a 'digest' version is C++ Coding Standards: 101 Rules, Guidelines, and Best Practices).

Never read it myself, but I hear 'Code Complete' is good. Maybe, too, Martin Fowler's Refactoring book - it shows lots of little awkward, problematic patterns and what to do about them, with good discussion. Each cleanly separated out - it will refer back and forth, but you can read the bits one-at-a-time. Good bathroom reading :)

Re: algorithms: Ugh, I don't know. It sounds like you'll want some metric data structures, dealing with space as you do. There's http://www.amazon.com/Foundations-Multidimensional-Structures-Kaufmann-Computer/dp/0123694469, and I don't know what else, maybe some Knuth? But probably, you should learn undergraduate-level data structures and algorithms, Big O stuff. Any used CS Data Structures + Algorithms book should help with that.

Do not fear spending money, as a former boss said, "books are free" ie they pay for themselves if they save you an hour's debugging later. Good luck!

u/[deleted] · 1 pointr/cpp

That reminds me.. here is a leak of the c++ coding standards for the Joint Strike Fighter. They could probably have avoided writing that thing if they just gone with this book instead.

u/sarevok9 · 0 pointsr/learnprogramming

I'll give this one a shot, since I've read through all your comments on here.

It seems as though you're interested in 'programming linux' in the literal sense that you wish to program an operating system similar to linux?

Now below you mentioned creating your own compilers, codebase, etc. So assuming that you're going to at LEAST start with the linux kernel (if not, writing your own kernel is something only a handful of people in the world know how to do, I can't even begin to instruct you on that.)

You're going to want to learn something to introduce you to programming in general to start with, Python is incredibly popular since it's 'easy' due to the minimal amount of syntax. If you don't have much experience, this would be a good place to start.

If you plan on making your own compilers, you're going to need to understand how C/C++ breaks into ASM, and further breaks into machine code / binary. This will be an extremely in-depth process, and you will generate a LOT of code in VERY low-level languages, which is why there are only a handful of compilers out there.

Now, continuing onto the actual linux OS itself, assuming you were editing the actual behaviors of the OS, you'll need to know a HUGE amount of C, as that's what a large amount of the native Linux code is programmed in. C, unlike python is a LOT of Syntax. C++ is like a less syntax intensive version of C that supports many of the same design ideology as C with some simplifications. It's not AS well suited at dealing with the lowest levels of computing that you'll be getting into with OS programming.

Now, next you're going to have to get into the hardware side of C, and that's where things get really hard. There are a set of tutorials here: http://www.learn-c.com/ that will give you a good place to start off. I cannot urge you enough to focus intently on the hardware aspects of things, as hardware support generally makes / breaks an OS.

Lastly, and perhaps most importantly. Make sure you understand design paradigms. Picking up a copy of:
http://www.amazon.com/Coding-Standards-Rules-Guidelines-Practices/dp/0321113586 might do you some good. Although it focuses on C++ there is a lot of generally good practices that you can take away from it. Chances are damn good you'll need C++ for this as well, and despite Linus talking out against C++ every now and again, it's a VERY robust language. Not suited for EVERY situation, but extremely well suited for others.

Hopefully this has made some sense. Good luck in your endeavors.