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, 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
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”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.”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.
Goals of code review
Goals of code review at CYF are:
- Checking/enforcing understanding of the material being covered
- Thinking about and improving general code style
- Learning/practicing using Git
- Learning/practicing the code review workflow
- Getting used to receiving feedback
We aim for trainees to produce perfect pull requests.
Solutions
Where to find solutions?
Trainees should not look at solutions before attempting the exercise, and should never just copy sample solutions.
Solutions are generally in a solutions
branch in the same repo.
Solutions are example answers not the only correct answers.
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.