File size: 3,456 Bytes
95d6173
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
---
description: 
globs: 
alwaysApply: false
---
# Coding Standards

This document outlines the coding standards for the AI-powered database interface, emphasizing the use of English in all code-related content and adherence to SOLID principles, Clean Code, and Design Patterns.

## Language Consistency

### Comments and Notes
- All comments and notes must be written in English.
- Avoid using any language other than English in code comments.
- Ensure clarity and conciseness in comments to aid understanding.

### Variable and Function Naming
- Use English for all variable and function names.
- Follow a consistent naming convention (e.g., camelCase, snake_case).
- Avoid using non-English characters or words in identifiers.

### Documentation
- All documentation, including README files and inline documentation, should be in English.
- Ensure that all code examples and explanations are clear and accessible to English-speaking developers.

## Best Practices

### Code Readability
- Write clear and descriptive comments.
- Use meaningful variable and function names.
- Maintain a consistent style throughout the codebase.

### Collaboration
- Encourage team members to adhere to these standards.
- Regular code reviews to ensure compliance with language consistency.
- Provide feedback and support for maintaining these standards.

## SOLID Principles

### Single Responsibility Principle (SRP)
- Each class should have only one reason to change.
- Ensure that classes are focused on a single functionality.

### Open/Closed Principle (OCP)
- Software entities should be open for extension but closed for modification.
- Use inheritance and polymorphism to extend functionality.

### Liskov Substitution Principle (LSP)
- Subtypes must be substitutable for their base types.
- Ensure that derived classes can replace base classes without affecting the correctness of the program.

### Interface Segregation Principle (ISP)
- Clients should not be forced to depend on interfaces they do not use.
- Design interfaces to be specific to client needs.

### Dependency Inversion Principle (DIP)
- High-level modules should not depend on low-level modules. Both should depend on abstractions.
- Use dependency injection to manage dependencies.

## Clean Code

### Meaningful Names
- Use descriptive names for variables, functions, and classes.
- Avoid abbreviations and unclear names.

### Functions
- Functions should be small and do one thing.
- Use descriptive names and avoid side effects.

### Comments
- Comments should explain why, not what.
- Avoid unnecessary comments and ensure they are up-to-date.

### Formatting
- Maintain consistent formatting and indentation.
- Use whitespace effectively to improve readability.

## Design Patterns

### Creational Patterns
- Use patterns like Singleton, Factory, and Builder to manage object creation.

### Structural Patterns
- Use patterns like Adapter, Bridge, and Composite to manage relationships between objects.

### Behavioral Patterns
- Use patterns like Observer, Strategy, and Command to manage communication between objects.

## Compliance

### Review Process
- Regular audits of the codebase to ensure adherence to language standards and design principles.
- Address any deviations promptly to maintain consistency.

### Training
- Provide training and resources to help team members understand and follow these standards.
- Encourage continuous learning and improvement in coding practices.