🧐 Reviewing

Everyone reviews code at CYF

Everyone reviews code at CYF

Mentors and trainees all review code, and collaborate on improving code quality. We are all helping each other to talk, write, and think about code more clearly.

Apart from in The Launch or Portfolio modules, when trainees are job ready, we are not reviewing code as if we were to merge this PR into production. We are opening a technical conversation for the purpose of insight and development.

Key points:

  1. Ask questions instead of making statements:

    YES: “Is there another element you could use to group a set of fields in a form? Why might someone use a different element in a form?”
    NO: “Use fieldset not divs”

  2. Encourage simplicity, clarity, and precision:

    YES “There are 15,0000 files in this changelist. Which files should be reviewed?”
    NO “It doesn’t matter; I can try to figure out what you meant.”

  3. Respect everyone’s work and time:

    YES “I think there’s some more to do here. Thanks for sharing where you’re up to.”
    NO “This is rubbish. Try harder.”

We recommend Code Review for Humans to develop your practice.

Labels

Reviewers, please add review labels (provided) to the PR once you’ve reviewed. This helps to focus the trainee on the areas they should work on, and gives an overview for mentors on what the whole cohort needs to work on.

Solutions

Where to find solutions?

Solutions might be in a solutions branch in the same repo, or in a separate repo. Add -Solution to the end of a repo url to find the solutions.

If you can’t find a solutions branch or repo, it’s because nobody has written one yet. Can you write one? CYF is the collective effort of many volunteers. Everything you see at CYF exists because a volunteer saw a need and worked to solve it. You can do the same.

Using the Solutions Repo

Solutions repo typically contain:

Sample solutions

Solutions are example answers not the only correct answers.

Common responses guides.

Everyone is invited to contribute commonly encountered problems, mistakes, misunderstandings, and mental-model errors to our common responses documents.

Use these resources to inform your code review, get unstuck, and improve your understanding.

More on code review

  1. Code Style Guide

  2. Things to look for in a code review

  3. What we teach and why