You are looking at lesson 4. Your place is still lesson 1, task 1: Algorithm.
.clang-format and Reformat Code (Ctrl+Alt+L), what the formatter doesn't do, and why the course has zero warnings.
Code is read far more often than it is written: by you a week later, by the lecturer, by a teammate. When the whole course writes in one style, you read code faster and see bugs sooner.
The repository root has a file called .clang-format: the course's style rules.
BasedOnStyle: LLVM
IndentWidth: 4
ColumnLimit: 100
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
The indent is 4 spaces, a line is at most 100 characters, and ifs and loops are never squeezed onto one line. CLion finds this file by itself, and the status bar at the bottom shows ClangFormat.
To format a file by these rules: Code → Reformat Code, or Ctrl+Alt+L. If you selected part of the code, only that part is formatted. You can also turn on formatting every time you save: Settings → Tools → Actions on Save → Reformat code.
Reformat Code takes care of spaces, indents and line breaks. Everything else is your job:
Names. average, not v. Variable names are written in lower case with _: birth_year. A loop counter can be i or j.
Braces { } on every if, else, for and while, even with one statement inside (topic 3).
Comments explain why, not what. The code already says what it does. This comment says nothing:
count++; /* increase count */
And this one explains what the code can't show:
int lowest = 10; /* the largest possible: the first grade replaces it */
Magic numbers. if (grade >= 5): what is that 5? const int pass_mark = 5; and if (grade >= pass_mark) say it themselves.
-Werror already turns warnings into errors, so a program with a warning doesn't even build. On top of that, CLion underlines suspicious places in yellow that the compiler doesn't count as errors: an unused #include, a variable whose value is never used. Hover over the underline and read it. You find all of a file's findings in the Problems window (Alt+6). The goal is simple: none.
GitHub CI builds with a newer GCC than CLion's, so it may show a warning (an error, with -Werror) that CLion didn't; you must fix it too.
Each one ticks itself when you do it.
All six done. You know your way around.
It is laid out like CLion: the same panels in the same places. This tour shows each one, and you can reopen it any time with Tour.
Switches the left panel: Lesson plan, Project files, Changes. Click the active icon again to hide the panel.
In CLion: the tool window bar runs down the left edge, too.
This part is not on this task: it appears when a task needs it.
Every task in this lesson. Now marks your place. Clicking a task only lets you look; it never moves your place. Project files and Changes open here too.
In CLion: this spot holds the Project view (the file tree).
This part is not on this task: it appears when a task needs it.
Opens the file for your task by itself. A tab appears for each file the step opens. The breadcrumbs above the code show the folder.
In CLion: the same editor tabs and breadcrumbs.
This part is not on this task: it appears when a task needs it.
Diff shows what changed, like git diff: red is the old code, green the new.
In CLion: the diff view in the Commit window looks the same.
This part is not on this task: it appears when a task needs it.
Terminal for build commands, Database to see your tables. They open by themselves when a task needs them. Drag the top edge to resize.
In CLion: Terminal, and the Database tool window.
This part is not on this task: it appears when a task needs it.
What to do now, right above the code, so you never miss it. Numbered notes in the code explain the important lines. Details shows what you should see and a hint.
In CLion: no equivalent: this is your lecturer's guide.
This part is not on this task: it appears when a task needs it.
Done is the only button that moves you forward. Look back lets you review without losing your place.
This part is not on this task: it appears when a task needs it.
Guided, Focus code or Floating. You can drag the panel edges too. Your layout is remembered for next time.
In CLion: you can also rearrange and hide tool windows.
This part is not on this task: it appears when a task needs it.
Six small missions. Each one ticks itself when you do it, so you know you have found everything.