MoeNavigator is an attempt to write a web browser that is highly configurable, secure, anonymous and fast.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
3.4 KiB

MoeNavigator development guidelines
Version control system:
The version control system used by the MoeNavigator project
is git. The main code repository is on, accessible via:
Before committing in the version control system make sure
that the source code can be compiled. Do not commit
if the source code doesn't compile! First try to find
the error by yourself. If you can't solve the error by yourself
report the problem to one of the developers.
C++ Programming guidelines:
- Make sure your code is readable and as lightweight as possible.
This means that code complexity shall be as minimal as possible
and no weird constructs shall be used.
- Do not use goto.
- Avoid the C memory allocation functions like malloc() or free().
Use smart pointers wherever possible.
- Do not include stdio.h or other standard header files that are designed for C.
Use the equivalent C++ headers instead (for example cstring.h instead of string.h).
- Avoid dependencies to external libraries for tiny functions
that can be implemented by yourself.
- Make sure all your source code is self-written. DO NOT, UNDER ANY CIRCUMSTANCES, COPY & PASTE SOURCE CODE!
- Put the GPLv3 license text at the top of every source file you create.
- Every header (.h) file has to include an #ifndef-#define-#endif statement
that wraps the whole source code in that header file.
If your header file is named FooClass.h that statement looks like this:
#ifndef FOOCLASS_H
#define FOOCLASS_H
//source code goes here
C++ Code writing style:
Code shall be written in the following style:
type ThisIsAFunctionName (type argument1, type argument2)
//after every opening curly brace insert four blank spaces
//for each line.
//after every closing curly brace remove four blank spaces
//for each line. With this it can easily be figured out
//to which loop/function a part of the code belongs to.
Class names are writte in UpperCamelCase, methods in lowerCamelCase.
Attribute names and variable names are written in snake_case.
Example: If your method shall be called "use new parser"
the name of the method will be "useNewParser".
If that function takes the argument "parser rule"
that argument is written "parser_rule".
Basic C++ types and streams:
Always use smart pointers when possible.
Int Types naming:
Integer types shall be written as int types. Examples:
- "short" => "int16_t"
- "long" => "int32_t"
- "unsigned short" => "uint16_t"
Standard output and standard error output:
Any debug output or notification shall be written to stderr.
C++ classes:
Every class must have its header file (.h) and, if needed, its source file (.cpp).
These files have to match the exact class name. If the class is MoeNavigatorFoo
the files shall be named MoeNavigatorFoo.h and MoeNavigatorFoo.cpp.
If a class shall be used as an interface it shall be made pure virtual.
C++ source code documentation:
The source code is documented via Doxygen. Class methods shall be documented
in the header file (.h). The documentation for a method shall be placed
above the method's head. The class documentation shall be placed above the class name.
Documentation text shall be wrapped between /** (opening) and */ (closing).