DLR-AMR / t8code

Parallel algorithms and data structures for tree-based adaptive mesh refinement (AMR) with arbitrary element shapes.

Home Page:https://dlr-amr.github.io/t8code/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coding style guidelines: Allow for C++ style comments: `// ...`

jmark opened this issue · comments

As of now, t8code guidelines enforce the old C commenting style /* ... */.

I propose to relax this.

Why?

Google favors //: https://google.github.io/styleguide/cppguide.html#Comment_Style

An excerpt from here: https://github.com/mcinglis/c-style?tab=readme-ov-file#use--comments-everywhere-never---

Stick to single-line comments, and cut the complexity. Compared to single-line comments, multi-line comments:

  • are rarely used with a blank margin, so they're just as character-heavy
  • have a style, which has to be specified and adhered to
  • often have */ on its own line, so they're more line-expensive
  • have weird rules about embedded /* and */
  • are harder/impossible to block-edit, and to extend
  • are more visually-cluttering than //

You have to use /* ... */ for inline comments in multi-line #defines, though:

#define MAGIC( x ) \
    /* Voodoo magic happens here. */ \
    ...

Follwing our Developer Meeting we allow C++-Style comments from now on.