Chapter 3. Conventions

Table of Contents
Naming Conventions
Parameter and Return Value Conventions
Code Formatting Conventions
Memory Management Conventions
Other Conventions

To shorten the learning curve, Inti places a lot of emphasis on consistent interfaces, with carefully followed conventions. This chapter lists the conventions; it may be helpful if you're trying to learn Inti, or trying to contribute patches to Inti.

Naming Conventions

Functions and variables. Functions and variables are named in lowercase, with underscores separating the words.

Member variables. Private member variables have a trailing underscore, as in foo_.

Getters/setters. Mutators that set an object attribute are called set_foo () where foo is the property being set. Accessors that retrieve the current value are called simply foo(). The type of the argument to set_foo () should match the return value of foo ().

Types. Types are named with each word capitalized, as in MyType. As a special exception, the STL does not follow this rule, because C++ specifies it this way. To make this seem semi-rational, Inti does not capitalize types that are subjectively determined to be STL-like, such as smart pointers and the UTF8 string class.