C++ Standards

Pages: 12
although some IDE's have an option to automatically convert tabs to spaces for you.


This. I always turn this on in IDEs I use.

tabs produce inconsistent looking code, as the tabs will look different to another person unless they're running the same editor and the same font face/size.

Spaces, on the other hand, look the same always.
closed account (3hM2Nwbp)
The #1 standard (to be)
nullptr

I usually prefer tabs over spaces because it's fewer keystrokes (especially in nested code)

I also prefer to append an underscore to my private variables.
Last edited on
+1 to jsmith's original comment.

As far as style goes, I think you should adhere to the style of the project you're working on. That applies to the use of braces, tabs, naming conventions and layout.

m_ was introduced by MFC. It's a standard for MFC classes. If you use MFC, use m_ as a prefix. It's consistent.

I've always used 0 instead of NULL for C++, but I can see where nullptr is a better choice (it isn't an int), so I'll be using that where available.
Topic archived. No new replies allowed.
Pages: 12