Developer Documentation
Conventions
Conventions
  • File and Folder Structure
  • Logging
  • Code Quality
  • Security
  • Code Style
  • Tools and Platforms
Powered by GitBook
On this page
  • Introduction
  • 1. Follow a consistent coding style
  • 2. Write meaningful comments
  • 3. Modularize code
  • 4. Error handling
  • Conclusion

Was this helpful?

Code Quality

In order to maintain a high code quality standard for our Urapolku application, we have outlined some conventions to follow. By using linting rules, we want everyone to succeed the quality checks.

PreviousLoggingNextSecurity

Last updated 1 year ago

Was this helpful?

Introduction

To maintain high standards of code quality, we have established these guidelines. Adhering to these guidelines will not only make our codebase more robust but also improve accessibility and maintainability.

There are 4 main rules to comply to:

1. Follow a consistent coding style

  • We will use the following linter: included in the Next.js Project. You will have to install the linting tools that get automatically downloaded when setting up the project.

  • We expect you to setup the linters for your code editor so that it will tell you about the mistakes that are made inside your code. If you need help with that you can reach out to other developers.

  • We want you to follow these linting rules, in such a way that all checks are passed when you commit your code to the repository. This will ensure a clean build and will make sure we comply with accesibility standards.

2. Write meaningful comments

  • Include comments to explain complex logic, algorithms, or unusual code.

  • Document functions, classes, and modules using comments.

  • Keep comments up-to-date with code changes.

3. Modularize code

  • Break down code into reusable and maintainable modules.

  • Encapsulate related functionality within functions or classes.

  • Avoid overly long functions or files.

  • Try to avoid complexity by reducing the amount of nesting of functions and if statements.

4. Error handling

  • Implement proper error handling for critical operations.

  • Use try-catch blocks for exceptions and provide informative error messages.

  • Log errors appropriately for debugging and monitoring. (See Logging Conventions)

Conclusion

By adhering to these Code Quality Conventions, we aim to create a robust Urapolku platform. These conventions will help us deliver a high-quality product and enhance the overall development experience.

Remember that continuous improvement is essential, so feel free to suggest updates to these conventions as needed. Together, we can achieve excellence in our project.

As a new developer, your code undergoes a review process before integration into the project. This ensures that all developers align with our guidelines. In cases where a developer may make mistakes or deviate from these guidelines, it falls upon more experienced developers to provide constructive feedback and guidance. Together, we aim to elevate the code quality of the Urapolku project.

It's important to note that every developer engaged in code reviews also collaboratively reviews each other's work to maintain consistency and pursue outstanding outcomes. In rare instances where a less experienced developer consistently struggles to adhere to these guidelines, further actions, including potential removal from the project without any compensation, may be considered. Our goal is to collectively excel and uphold our project's standards.

ESLint
JSDoc-style