-
Notifications
You must be signed in to change notification settings - Fork 1
Quarto Java style guide
Project IPSEN1-Quarto
Group 3, Inf1G
- Indentation - Use 4 spaces
- Line Length - Up to 80 characters
- Variables, properties and functions - lowerCamelCase
- Class and interface names - UpperCamelCase
- Constants - ALL_UPPER_CASE_WITH_UNDERSCORES
- Package names - lowercase
- Always specify whether a method or property is public/private/protected.
- Use private properties by default, create getters/setters for them as needed.
- Favour private properties/methods over protected ones.
- Put your opening curly brace on the same line as the expression.
- For an if-statement with a single statement, braces are not mandatory.
Use comments only when appropriate. Do not use them when the code you're explaining is obvious. Always strive to write easy to read, self-explanatory code instead.
- Do not commit code that doesn't compile.
- Do not commit code that's commented out. We have source control for that.
- Please write good commit messages.
Optional: Write unit tests for your code if you're willing and able.
Create a branch for every new feature or bug fix you're working on. This is more structured than committing straight to master, prevents merge conflicts, and allows for easy code review through diffs and pull requests. Use all-lower-case-with-dashes
for the branch name, with only alphanumeric characters.
Don't forget to perform a git pull (and rebase if needed) before pushing your new branch up to GitHub.
Once you're ready to merge your branch into master, use a non fast-forward merge (git merge --no-ff topic-branch
). This ensures a merge commit is created, which can easily be reverted.