Code Review

Overview

Every week, our students complete coursework which aims to
  • Put what they've learnt into practice
  • Stretch their abilities
  • Display progress in their learning
Each week's coursework consists of
  • Reading
  • Watching videos, either
    • Explainers
    • Introductions, or
    • Code Alongs
  • Coding Exercises
and
  • Coding Challenges
Trainees submit their coursework and we give feedback. This feedback is a vital part of our trainees' development.

Technical Mentorship: Process

1) Finding Coursework

Coursework including code is always hosted as a Pull Request on GitHub.
Every week of the course has some coursework attached to it. Trainees open a pull request and unit tests are run. You might want to set up code review assignment system in your buddy team. Where do students submit coursework?
You can find all of a students open pull requests by using https://github.com/pulls?q=is%3Apr+is%3Aopen+author%3A${author}
And you can fetch from the GH Search API like this if you want to set up a notification:
Exercise 1 (5 minutes)
Can you find the homework from these students?
1) Git Week 1 - Chris Owen
2) All of ChrisOwen101's open pull requests
Every week has a solutions repo Tech Mentors have access to. If you can't find the repo, you are not in the Mentor team on Github and you need to join that. Ask on Slack.
The solutions repo has a marking guide with the most common mistakes and suggested responses in it. You can also share the solutions directly with your trainees after the coursework deadline has passed, and encourage them to use it to review their own code.

2) Giving Feedback

Be Positive
Above all else be positive and be kind. Our trainees want to learn and want to understand.
You should pull out small wins from bad code and encourage them to continue and try again. Many of our trainees suffer from low confidence and a well timed comment of motivation can be all it takes to push them to success.
If in doubt, consult our key rules.
Directing to Resources
If you can tell that someone has been struggling with a particular area one key way that you can help is to
  1. 1.
    Acknowledge that they have struggled
  2. 2.
    Re-assure them that many people struggle with such problems
  3. 3.
    Direct them to an online resource that will help them understand the problem better
We should try to shy away from writing long, complex explanations to trainee problems. This can be a time sink, especially when great resources already exist. Try to spend as much time directly interacting with your trainees as you can. In other words: talk to them.
Please note: Do not just link to documentation! Link to a tutorial or guide that explains the documentation.
Fixing Bugs
If the bug is a simple compilation or formatting error, suggest a line fix to the issue. An incorrect relative URL, for example, is a simple error that does not imply a deeper misunderstanding of the content and so can be safely fixed. If your trainee persistently makes typos, work with them on error checking in the IDE, rather than cleaning up on Github for them.
Prompting to Ask Questions
Make every error a teaching moment, mention that you see other people struggling with the same concepts and that asking questions on Slack can be a way to remedy their problems.
Explaining an Obvious Mental Model Issue
When a trainee implements code in a way that seems nonsensical the root cause can often be a misconception in how they have built their mental model. If you can obviously tell from their homework what their misunderstanding is then you are encouraged to correct them.
If they seem to fundamentally misunderstand a concept then it is best to refer them back to the source material.
Formatting
It never hurts to remind the trainee of the importance of proper formatting and indentation. They should have Prettier installed in VSCode.
All code that our trainees write should follow our Style Guide. It's ok to remind them to self review this.

Quickly Giving Feedback

Visual Studio Github Plug-in
The VS Code studio plug-in can help speed up moving between pull requests and making comments.
It allows you to make comments from directly inside and VS Code and allows each comparison between Pull Requests.

Use the Code Review tools directly on Github

Do code review directly in Github using the PR tools. This is an important skill to demonstrate to your trainees and a good one to develop yourself if you haven't done this much yourself. There's more stuff in the main docs around this, and you might find this useful: Google Code Review Guide.
It is not your responsibility to check that every line of code is perfect. Our trainees must learn to evaluate their own code. But they need to learn to do that by seeing it done by you, their mentor.

3) Label the Pull Request

When you have given feedback, add the label "reviewed".
If the homework has not been completed you should also add the tag "not-completed"

4) Tracking progress

Trainee progress is tracked automatically in a trainee tracker sheet. Tech Ed are given access to their cohort's tracker by the Programme Manager in their region.

Where do trainees submit coursework?

Coursework is listed on the syllabus and the Github org. For example, this is the first lesson for HTML/CSS
And here is the relevant coursework
Coursework | CodeYourFuture Syllabus
The Table of Contents (first pinned repo on Github) links to all the coursework repos.