Difference between revisions of "C/C++"

From HCL
Jump to: navigation, search
Line 10: Line 10:
 
== C++ ==
 
== C++ ==
 
* [http://developers.sun.com/solaris/articles/mixing.html Mixing C/C++]
 
* [http://developers.sun.com/solaris/articles/mixing.html Mixing C/C++]
 +
* Provide main API in C
 +
* Use plain C unless you need flexible data structures or [[STL]]/[[Boost]] functionality
 
* [http://en.wikipedia.org/wiki/Template_metaprogramming Template C++] is preferrable from the point of view of runtime performance
 
* [http://en.wikipedia.org/wiki/Template_metaprogramming Template C++] is preferrable from the point of view of runtime performance
* Use plain C unless you need flexible data structures or [[STL]]/[[Boost]] functionality
+
* Mind the life cycle of objects: [http://en.wikipedia.org/wiki/Default_constructor Default constructor] [http://en.wikipedia.org/wiki/Copy_constructor Copy constructor], [http://en.wikipedia.org/wiki/Destructor_(computer_science) Destructor]
* Provide main API in C
 
  
 
== General ==
 
== General ==

Revision as of 19:37, 5 March 2010

Coding

Commenting

  • Place Doxygen comments in header files (before declarations of namespaces/classes/structs/typedefs/macros) and main source files (for documenting tools and tests)
  • Use double forward slash for short comments in the code

C++

General