Skip to content

Robomongo Coding Style

schetnikovich edited this page Jan 9, 2013 · 41 revisions

In general, we follow MongoDB style guides, which in turns tries to follow Google C++ Style Guide.

The most important rules are:

#includes

Use "double quotes" for Robomongo code, <angle brackets> for 3rd party or library headers, including MongoDB files:

#include <QStringList>
#include <boost/shared_ptr.hpp>
#include <mongo/client/dbclient.h>

#include "robomongo/core/Core.h"
#include "robomongo/core/MongoElement.h"

All of a project's header files should be listed as descendants of the project's src/ source directory without use of directory shortcuts (. and ..).

Correct:

#include "robomongo/core/MongoElement.h"

Wrong:

#include "core/MongoElement.h"
#include "../core/MongoElement.h"
#include "MongoElement.h"

Clone this wiki locally