Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-5791

Make C++ training and code style presentation and present to team

    XMLWordPrintable

    Details

      Description

      Acceptance criteria:

      • Decide on a code style suggestion.
        • Could consider https://google.github.io/styleguide/cppguide.html as a starting point, since it is very comprehensive.
        • We might need some exceptions though, for example the indentation level is 2, which would be different from all our other projects (and 2 is bordering on being hard to read IMHO)
      • Make presentation which acts both as a C++ training, and a suggestion for code style.
      • Schedule presentation, carry it out, and agree on the code style in the presentation.
      • Record the presentation so future C++ devs can watch it.

      Slides from documentation: PDF, ODP original, and video recording.

      Conclusions from meeting 2022-11-10:

      See the slides for exactly what this is referring to.

      • Local variables - We will use my_variable style local variables.
      • Namespaces - We will allow, and indeed enforce, usage of using namespace std, which must be present in every file unless there are good reasons not to. It is not allowed to import other namespaces this way, they must be typed out in each call.
      • Indentation - With a tie-breaking vote, we chose tabs for indentation.
      • Access specifiers - We will not indent access specifiers, in other words, they will stay at the same level as their parent. Members are indented one level.
      • Function calls - The expanded a bit into other types of indentation too. We didn't make an exact decision on everything, but the general consensus was:
        • For all cases, pick a style which doesn't mix tabs and spaces. IOW basically everything must operate in "indentation levels", not in number of characters.
        • This means no alignment to arguments on previous line, etc. Basically no alignment, period.
        • Use Python's Black formatter as inspiration, but also check out what the various formatters, most notably clang-format, already do.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              a10040 Kristian Amlie
              Reporter:
              a10040 Kristian Amlie
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: