Skip to content

About

Ray Tracing enging for simulating the Solar System

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

82 Commits

Folders and files

Repository files navigation

Raytrace2

Conventions

Basic conventions

Do not use the standard namespace library, especially in header files.

Wrong usage: example.h
using namespace std; THIS IS WRONG!!!
Correct usage: example.h
void function() 
{
    std::cout << "Hello" << std::endl;
}

After each statement (if, for, foreach, switch, etc), the brackets must always go in new line.

Examples:

if (...)
{
    // code goes here...
}
for (...)
{
    // code goes here...
}
switch (...)
{
    // code goes here...
}
if (...)
{
    // code goes here...
}

Variables

Every variable should use the camel case naming convention.

class Example
{
private:
    int camelCaseExample;
public:
    Example() {};
}
int main()
{
    int camelCaseExample = 1;

    return 0;
}

Classes

Class names should follow the upper camel case naming convention.

Correct naming: example.h
class ExampleClass 
{
}
Wrong naming: example.h
class exampleClass 
{
}

class example_class 
{
}

class exampleclass 
{
}

Classes must be separated into different .h and .cpp files.

Header files must not contain any implementation just the header of the functions and the variable declarations.

Header file: example.h
int main()
{
    int camelCaseExample = 1;

    return 0;
}
Source file: example.cpp
int main()
{
    int camelCaseExample = 1;

    return 0;
}

Functions

Function names should always use the snakecase naming convention.

Example:

void snake_case_example_function() 
{
    // Function body
}

About

Ray Tracing enging for simulating the Solar System

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages