Commit e9bf706d authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille
parents f1b11413 b378b935
Please follow those rules when developing:
==========================================
Static (variables, members, attributes) should start with a capital letter
Class name should start with a capital letter
Mix capital and normal letter to write names (IAmAName) no underscore (but if you have several variables that looks the same be careful: thisIsAXVariable thisIsAYVariable)
Put const every where it is possible (method, value, pointer etc.)
Declare variables usually as late as possible (we are not in C so do not declare every thing at the beginning of a function)
Declare index in the for loop where they are used
Use pre-inc if possible
If an parameter is changed by a function use pointer else use const ref
Please do not name variables with one letter (except it is related to a mathematical formula but then this one should be in the comment in latex format)
Try not to have function bigger than 100 lines
Be consistent
Methods should start with a verb or an action (get, compute, print, etc...)
Please follow those rules when developing in scalfmm:
=====================================================
1 - Static (variables, members, attributes) should start with a capital letter
2 - Class name should start with a capital letter
3 - Mix capital and normal letter to write names (IAmAStaticName, iAmAName) no underscore (but if you have several variables that looks the same be careful: thisIsAXVariable thisIsAYVariable)
4 - Put const every where it is possible (method, value, pointer etc.)
5 - Declare variables usually as late as possible (we are not in old C so do not declare every thing at the beginning of a function). Of course, variable that are used in a loop but with always the same value can be declared at the function beginning.
6 - Declare index in the for loop where they are used (and their names should start with "idx")
7 - Use pre-inc if possible (even if the compiler will optimized post-inc for native type)
8 - If a parameter is changed by a function use pointer else use const ref (if the size of object is less than 20 Bytes you can pass it by value, moreover if it is intensively used!)
9 - Please do not name variables with one letter (except if it is related to a mathematical formula but then this one should be in the comment in latex format)
10 - Try not to have function bigger than 100 lines
11 - Be consistent
12 - Methods should start with a verb or an action (get, compute, print, etc...)
13 - If some code are here temporary (for testing, assertion, etc), put it in a section "{}", and add a comment that explicitly says that it can be removed "todo remove this section" for example.
14 - Sometime no comment is better than outdated (or wrong copy-pasted) comments.
15 - Plain-data struct can be used if it seams natural to use container without method.
Why everything is inside the HPP!? A discussion about why scalfmm should stay like this for now
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment