Skip to content

Latest commit

 

History

History
71 lines (52 loc) · 1.3 KB

DEV_COMMENTS.md

File metadata and controls

71 lines (52 loc) · 1.3 KB

Comments on Development of mmspa Library

This is a pure C library. ANY C++ feature is not welcome. So far, it is tightly coupled with PostgreSQL/PostGIS database, which is not good. The external data source will become configurable in the future.

Coding Standards

Public functions

Internal public functions

The functions are visible to all across the library, but invisible to external clients.

void DoSomething();

External public functions

The functions are visible to all across the library as well as the external clients. In other words, they are the APIs. Here I use the MSP instead of MMSPA for abbrevating Multimodal Shortest Paths because it is more concise.

void MSPdoSomething();

Constants

ALL_CAPITALS_WITH_UNDERSCORES_SEPERATED

Local functions, variables and parameters

All private functions should be declared as static. The first letter should be lowercase.

static int localVar;
static void localFunction(int firstParam, char *secondParam);

Member variables

struct Demo {
    int all_lowercase_with_underscores;
}

Curly braces

for (i = 0; i < 10; i++) {
    doSomething();
    doSomeOtherThing();
}
if (cond > 0) {
    doThis();
    doThat();
} else {
    doSomething();
    doSomethingElse();
}