Thursday, December 16, 2010

BitSquid C++ Coding Style

The BitSquid Coding Style Guidelines:


  1. Almost the same as the Google C++ style guide (,which I use and love ;).

  2. I agree with everything but the underscores for variable and function names. I find camel case easier to read than underscores.

    That said, I definitely feel it IS something that I feel should be specified. I'd rather read and code underscores than have a mix anywhere in the code.

    Lastly, the one place I feel a piece of "hungarian-esq" notation works is notating an argument to a function:
    my_func(int a_argument1, int a_argument2)
    // code body

    Though this might harm the type of readability you're looking for, it differentiates arguments from local variables and can help someone scanning the code figure out where the variable came from easily, especially in longer functions (e.g. whether it's a calculated value local to the function or passed in).

  3. I-actually-like-dashes-best,-but-unfortunately-that's-not-valid-C++. Underscores_are_the_next_best_thing_because_what_you_write_is_still_quite_readable. CamelCaseIFindNotVeryReadableAtAll,ButIGuessYouCanGetUsedToIt.

    I haven't felt the need to distinguish arguments, to me they don't seem "special enough" and I like to keep the functions short. Actually I'm not so sure on the hungarian notation on member variables either. It might be clearer to just write this-> everywhere... it's a bit more typing though... and harder to enforce. But all of this is a matter of taste anyway.

  4. When I sit and code in visual studio, i think its nice for example to write m_ and then press ctrl-space to get all member variables. Or for example to write class.get and press ctrl-space to get all the getters from the class. Thats one big reason I think to write m_ before members and get before get functions.

  5. I was refering to this excellent post from time to time, but unfortunately, the link pointing to the coding style stopped working. Is it available anywhere else?

    1. Thanks for noticing, I've found a new home here:

  6. This is a great article, with lots of information in it, These types of articles interest users in your site. Please continue to share more interesting articles!
    Quickbooks contact helps you with everything regarding QuickBooks software. If you are stuck in some general issues related to QuickBooks like installation error or payroll issues then we are here to help you anytime you want.

  7. yes c++ is a language. it is used to create a programs. it's most common application used in nowadays.
    windows spotlight quiz is also made by this language

  8. I was surfing net and fortunately came across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. Thanks for sharing this wonderful information.

  9. Zip file is the most widely used file creating process. Using this, we can zipped a number of files inside one single file folder. It is also a type of compressed file that can easily send and retrieve different types of data and information. To know how to create it on Windows 10, then visit open zip file windows 10.

  10. Great to see your blog..