Lesson 15, Thursday, 2026-05-07
this is a new lesson format we are experimenting with this semester, feedback welcome!
One or more people examine the work of someone else. Usually happens in teams before considering the code to be ready.
- Helps catch bugs early on
- Improves code quality, reliability, and maintainability
- Enhances learning through feedback
- Promotes team collaboration and communication
- Review code for clarity, not just bugs
- Suggest improvements, don’t just criticize
- Ask questions if unclear about logic
Give your feedback on this code:
let n = 3;
let p = 8;
console.log(n * p);Variable names could be better
Give your feedback on this code:
let numFriends = 2;
let ticketPrice = 2;
let totalPrice = numFriends ** ticketPrice;
console.log(totalPrice); // output is 4There is a bug, it should be *, not **
Give your feedback on this code:
function isUserActive(user) {
if (user.isDeleted === true) {
return false;
} else {
return true;
}
}
let userActive = isUserActive(user);It can be simpler: let userActive = !user.isDeleted
before peer review, always look at your code with a critical eye before considering it ready, it saves time for others, and it helps make the code easier to understand.
Ask yourself the following questions:
- Would my teammates understand this?
- Would I understand this if I came back to it in 6 months?
- Does this do what it is supposed to do? Does it actually do what i think it does?
Some good habits:
- Take a break before reviewing
- Git diffs / Pull requests
- Rubber ducking
You can use AI tools to help you do the review, but you need to ask the right questions, and think critically about the output.
Now try it with some of your code from previous tasks
- What did it say? Does it make sense?
- Do you know if its better? why?
- Can you change adapt your code accordingly?
Additional Resources:
- Why you need a self review of your code
- How to review code effectively: A GitHub staff engineer’s philosophy
- How to do a code review
- Code Review good practices: guide for beginners
- Review your own pull requests
- Empathy and code reviews
- Individual or team of 2-3 people
- Fill out the info in the spreadsheet!
- Internal presentation date TBD, you will present your project to the class
- Some projects at Demo Day (different by location)
- Nominate yourself
- Data visualization of the flee markets in Berlin
- Calendar for Remote work
- Grocery shopping list
- AI in the browser
- Personal Portfolio
Latest Chrome beta can run small AI models in the browser!
let model = await LanguageModel.create();
let answer = await model.prompt("Why is JavaScript awesome?");
// or detect language
let detector = await LanguageDetector.create();
let result = await detector.detect("Merci common ca va?");Documentation: https://developer.chrome.com/docs/ai/built-in
Define a Minimum Viable Product (MVP)
Implement essential functionality, and if there's still time, implement the "nice to have" features.