Course contentsShow
← Software Engineering
Lesson 95 of 1,9333. Collaboration with GitFree lesson

Giving Constructive Feedback

Writing actionable, specific, and respectful review comments that improve code without discouraging contributors.

Giving Constructive Feedback

You'll learn how to write code review comments that help teammates improve their work while maintaining a positive, collaborative atmosphere.

Why Feedback Matters

When reviewing code, your comments can either energize your teammate to write better code or discourage them from contributing. The difference lies in how you communicate your observations. Remember: code review isn't about proving you're smart—it's about making the codebase better together.

The Three Principles of Constructive Feedback

1. Be Specific and Actionable

Bad: "This function is messy."
Good: "Consider extracting the validation logic into a separate function to improve readability."

Vague criticism leaves the author confused. Specific suggestions give them a clear path forward.

2. Focus on the Code, Not the Person

Bad: "You always forget to handle edge cases."
Good: "This function doesn't handle the case when the array is empty. Should we add a check?"

Use "we" instead of "you." Frame observations as questions when appropriate. This keeps the discussion collaborative rather than accusatory.

3. Explain the "Why"

Bad: "Don't use var here."
Good: "Let's use const here instead of var to prevent accidental reassignment and improve scope clarity."

Help your teammate learn by sharing the reasoning behind your suggestion. This turns every review into a teaching opportunity.

Positive Feedback Counts Too

Don't only comment on problems! Note clever solutions or improvements: "Nice use of early returns here—much cleaner than nested conditionals."

Key Takeaway: Constructive feedback is specific, respectful, focused on the code rather than the person, and includes the reasoning behind suggestions—turning code reviews into collaborative learning experiences.