MALBECC / lio

Linear implementation of DFT calculations (CPU and GPU)
GNU General Public License v2.0
26 stars 18 forks source link

To add to a C/CPP/CUDA conventions #109

Open fedepedron opened 7 years ago

fedepedron commented 7 years ago

(I'm @ramirezfranciscof )

Things to add to the guide on how to program in C/CPP/CUDA

(1) Add headers in the .cpp files when possible, in the .h when there is no choice (ex: when declaring types that are defined in another .h). source

(2) Includes always outside of namespaces.

To be continued...

fedepedron commented 7 years ago

¿Perhaps implementing the #ifndef / #define / #endif guard inside headers?

fedepedron commented 7 years ago

(3) Families of subroutines inside namespaces, classes are for objects. Source

(4) When classes are inside a namespace, the definition of is methods is as shown in this link. It seems to usually be a good a idea to put classes inside namespaces (source). Also check: anonymous namespaces.

fedepedron commented 7 years ago

(5) Resolve issue of where to define templates (.h or .cpp) and where to specialize them (see first answer)

fedepedron commented 7 years ago

(6) First write #includes< banana >, then #includes "localbanana". And sort them alphabetically.

manuelF commented 6 years ago

160 is the first step, where everything is formatted. After this, all the improvements make more sense on a standandarized codebase.