Skip to content

Developer Guidelines

Nguyễn Xuân Nhân edited this page Dec 21, 2023 · 1 revision

Introduction

These developer guidelines provide a framework for maintaining consistency, efficiency, and best practices in our development processes. Adhering to these guidelines will help us produce high-quality software and collaborate effectively within our development teams.

Principles

SOLID, KISS, YAGNI and DRY

  1. SOLID Principles

    • Single Responsibility Principle (SRP): Each class or module should have only one reason to change.
    • Open-Closed Principle (OCP): Software entities should be open for extension but closed for modification.
    • Liskov Substitution Principle (LSP): Subtypes must be substitutable for their base types without altering the correctness of the program.
    • Interface Segregation Principle (ISP): Clients should not be forced to depend on interfaces they do not use.
    • Dependency Inversion Principle (DIP): High-level modules should not depend on low-level modules; both should depend on abstractions.
  2. KISS (Keep It Simple, Stupid)

    • Strive for simplicity in design and code. Avoid unnecessary complexity.
    • Write code that is easy to read and understand.
  3. YAGNI (You Aren't Gonna Need It)

    • Don't add features or code that you anticipate needing in the future but do not currently need.
    • Focus on delivering functionality required by the present requirements.
  4. DRY (Don't Repeat Yourself)

    • Avoid duplicating code or logic in multiple places.
    • Use abstractions to avoid repeating code.

Dependency Injection

  1. Dependency Injection

    • Use dependency injection to decouple components and facilitate testing and maintainability.
    • Avoid hard-coding dependencies in classes and modules.
  2. Inversion of Control

    • Use inversion of control containers to manage dependencies and object lifetimes.
    • Avoid manually managing object lifetimes.

Separation of Concerns

  1. Separation of Concerns

    • Separate concerns into distinct modules, classes, and functions.
    • Avoid mixing unrelated functionality in the same module, class, or function.
  2. Single Responsibility Principle

    • Follow the single responsibility principle to ensure that each module, class, or function has only one reason to change.
    • Use descriptive names for modules, classes, and functions to indicate their purpose.

Development Process

Agile and Scrum

  1. Agile Methodology

    • Embrace the Agile development methodology, which emphasizes iterative and collaborative development.
  2. Scrum

    • Follow Scrum practices for project management, including regular sprint planning, daily stand-ups, sprint reviews, and retrospectives.
    • Collaborate with cross-functional teams to achieve project goals.

CI/CD

  1. Continuous Integration

    • Use continuous integration to automate the build and testing of code changes.
    • Ensure that code changes are tested and merged into the main branch frequently.
    • Use a CI tool such as Jenkins to automate the build and testing process.
  2. Continuous Delivery

    • Use continuous delivery to automate the deployment of code changes to production.
    • Ensure that code changes are deployed to production frequently.
    • Use a CD tool such as ArgoCD to automate the deployment process.

Gitflow Workflow

  1. Gitflow Workflow

    • Use the Gitflow workflow to manage code branching and releases.
    • Follow the branching strategy of feature branches, develop, release, and master branches.
  2. Version Control

    • Commit frequently with clear and descriptive commit messages.
    • Ensure code changes are well-documented in pull requests.

Coding Standards

  1. Code Consistency

    • Adhere to a consistent code style guide (e.g., PEP 8 for Python, ESLint for JavaScript) for the respective programming language.
    • Use meaningful variable and function names.
  2. Code Reviews

    • Conduct thorough code reviews to identify and address issues related to code quality, security, and maintainability.
  3. Testing

    • Write unit tests for code to ensure functionality and catch regressions.
    • Implement automated testing wherever possible.
  4. Documentation

    • Document code, APIs, and configuration as necessary to facilitate understanding and maintenance.
  5. Performance

    • Optimize code for performance when required, but avoid premature optimization.
  6. Security

    • Follow secure coding practices to prevent common security vulnerabilities.
  7. Naming Conventions

    • Use descriptive names for variables, functions, classes, and modules.
    • Use consistent naming conventions for variables, functions, classes, and modules.

Conclusion

By following these developer guidelines, we aim to foster a culture of collaboration, quality, and efficiency in our development efforts. Regularly reviewing and updating these guidelines will ensure that our development processes remain effective and aligned with industry best practices.

Clone this wiki locally