Hi, im starting my first project which may eventually become open source, so i want to get the conventions right. Do the names of classes get capitalized.
Hi, im starting my first project which may eventually become open source, so i want to get the conventions right. Do the names of classes get capitalized.
Yes, that is what most people do, but I don't think it's defined in the standard. It's usually a good idea to follow the conventions though, as it makes your code more readable to others.
depends what style you're writing with. It can go either way.
but usually all caps are used for defines, so they sometimes aren't used for classes.
thank you
Here's my own standard (and the company I used to work for):
- Class names begin with a capital letter and the first letter of each word is capitalized. Eg. class AntiSpamScanner
- Public member functions follow the same rules as classes. Eg. ScanFile()
- Private (or protected) member functions begin with a small letter. Eg. scanFile()
- Member variables begin with 'm_' and then each word begins with a capital. Eg. std::string m_RemoteFile;
- Macros are ALL capitals. Eg. #define SQUARE_NUMBER( num ) (num)*(num)
- Variables begin with a small letter. Eg. std::string fileExtension;