Symbian OS Code Conventions and Notations Used in the Book

For you to get the most out of this book, let's quickly run through the notation we use. The text is straightforward, and where we quote example code, resource files, or project definition files, they will be highlighted as follows:

This is example code;

Symbian C++ uses established naming conventions. We encourage you to follow them too, in order for your own code to be understood most easily by other Symbian OS developers, and because the conventions have been chosen carefully to reflect object cleanup and ownership, and make code more comprehensible. An additional benefit to using the conventions is that your code can then be tested with automatic code analysis tools, which can flag potential bugs or areas to review.

The best way to get used to the conventions is to look at code snippets in this book, and those provided with your chosen SDK.

Capitalization

The first letter of class names is capitalized:

Class TColor;

The words making up variable, class, or function names are adjoining, with the first letter of each word capitalized. Classes and functions have their initial letter capitalized while, in contrast, function parameters, local, global, and member variables have a lower case first letter.

Apart from the first letter of each word, the rest of each word is given in lower case, including acronyms. For example:

void CalculateScore(TInt aCorrectAnswers, TInt aQuestionsAnswered); class CActiveScheduler; TInt localVariable; ...

Get Quick Recipes on Symbian OS: Mastering C++ Smartphone Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.