Coding Notes

Code Reviews

By Rae

Code Reviews

Humans make mistakes

We need feedback at every level

Notes

  • Great to give feedback because explaining something helps you learn it.
    • gain experience reading ccoe
    • see dif solutions to same problem
    • Learn to talk about code
    • Share Knowledge
    • Find and fix bugs
    • show best practices
    • Learn something new
  • How to get started
    • First Glance at the app (design and functionality)
    • Get an overview of the code (what's happening, any obvious findings (structure, indentation, comments, etc.))
    • Read through the code (Do you understand the codes job (if not: is it unfamiliar to you, is it poorly written))
    • Take Notes (code comments, note file, paper, notes are meant to be private)
  • Structure your Review
    • Highlight the good stuff!
    • Suggest Improvements. Walk through solutions step by step. Find a nice balance, too much is overwhelming.
    • Sometimes explain concepts that are unfamiliar to the person. (naming conventions, heading hierarchy, data attributes, how to refactor code, writing DRYer code) - only if they're ready and it isn't too much!!!
  • What to look for (not everything)
    • Functionality
    • Code formatting
    • Consistency
    • Simplicity
    • Unused Code
    • Praise the coder!
    • Doctype and lang attribute
    • Semantic HTML (header, footer, main, section, article) - is there div soup
    • Meaningful names (classes, variables, functions, components, files, ect.)
    • Structure of files and code (is it easy to find what you're looking for?)
    • Indentation and Spacing
    • Repetition (the DRY principle)
    • Design (Figma design specs, do you like it if they have their own twist, responsiveness, etc.).
    • Common Conventions (classes VS ids, const VS let, camelCase vs cobbob-case)
    • Accessibility
      • Navigation: keyboard navigation, size and spacing on clickable elements, unambiguous link/button texts.
      • Styling: color contrasts, hover/focus style.
      • AT (assistive technology): alt text, labels, heading hierarchy, visually hidden elements.
  • Record Review In Scrimba
    • click start recording
    • choose microphone
    • runs as long as you want
    • edit Review
    • publish review
  • Github is where most code reviews happen, specifically on pull request.
  • In a github pull request the green code is new and the red is old.
  • Code reviews provide growth. You learn how to give feedback and form sharper coding instincts.
  • Over-the-shoulder review
    • Provide suggestions through a conversation.
    • Often more immediate, nuanced feedback.
  • Use the sandwich approach (possitive, constructive, possitive).

Resources

Definitions

Questions

Opinions