-
Notifications
You must be signed in to change notification settings - Fork 0
Clean_Code_and_Code_Reviews
Write at least five characteristics of good code on posts it. We will collect them in the class.
Have a look at the clean code principles for JavaScript by Ryan McDermott. Pick one that we have not collected in the class and that you find important. Explain it to the class and why you find it important. Do you find one that you disagree with? If yes, present it and explain why.
Versioning your code is especially important, when you develop components that are going to be re-used by third parties, for example a code library, a REST API or a model.
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes
- MINOR version when you add functionality in a backwards compatible manner
- PATCH version when you make backwards compatible bug fixes
What are good commit messages? Conventional commits is a style of writing commit messages that makes it easier for other developers to understand your commit history and even allows tools to automatically generate a change log for your releases.
- Ensure code quality
- Share knowledge
- Increase collaboration
The feature branch workflow is a way for using git that aligns well with the practice of code reviews. Note that merge requests and pull requests are different terminology for the same thing on different platforms. Gitlab calls it merge requests and Github uses pull requests.
- Follow the feature branch workflow
- Create an issue for each feature. Include a definition of done in the issue
- Once you start working on an issue, create a merge request. Merge requests are also called pull requests on some platforms.
- Once you want to merge, mark the merge request as ready and tag someone else to review the merge request.
- As a reviewer, you pay attention to
- The definition of done: Does the code do what it claims to do? Did it miss any corner cases?
- Clean code: Does it follow clean code principles? Is it writte in a way, that you can understand it?
- Side effects: Do you spot an any side effects or other issues?
- The solution: Can you think of a better solution? In what way is your idea better? Simple, more efficient, ...?
- Your language: Be friendly. You are commenting on someone else's effort
Image Credit: Geek and poke
From now on, follow the feature branch workflow and have all merges into master reviewed by someone else. Make sure that the reviews are balanced across the class. Each student from focus I has to hand in three code reviews that they performed at the end of this block.
Studio Web & Mobile Design & Engineering 1 – 2022 © Digital Ideation, HSLU, Maria Husmann und Hanna Züllig
Projektbriefing
Workshop Konzept
Design Inhalte