Welcome to the Code Style Guidelines repository! This project aims to provide a comprehensive set of coding standards and best practices to maintain consistent and high-quality code across UnifiedBits projects. Our guidelines cover multiple programming languages and tools, ensuring readability, maintainability, and smooth collaboration among team members.
- Introduction
- Languages Covered
- Getting Started
- Guidelines
- Testing Standards
- CI/CD Practices
- Contributing
- License
- Releases
In software development, consistency is key. Following a set of coding standards helps ensure that everyone on the team writes code in a similar manner. This leads to better readability and maintainability. The Code Style Guidelines repository is designed to help you adopt best practices in your coding journey.
For detailed information and updates, please visit our Releases section.
This repository includes guidelines for the following programming languages:
- C++
- C#
- Dart
- Flutter
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Rust
- TypeScript
To get started with our coding standards, clone this repository:
git clone https://github.com/Bluehead80/code-style-guidelines.git
Once you have cloned the repository, navigate to the directory:
cd code-style-guidelines
Here, you will find folders and files dedicated to each language. Review the specific guidelines for the language you are working with.
- Readability: Code should be easy to read and understand. Use meaningful names for variables, functions, and classes.
- Consistency: Follow the same style throughout the codebase. Use the same naming conventions and formatting.
- Documentation: Comment your code where necessary. Use docstrings for functions and classes to explain their purpose.
- Version Control: Use Git for version control. Make clear and concise commit messages.
- Use
camelCase
for variable names andPascalCase
for class names. - Indent with spaces, not tabs. Use four spaces per indentation level.
- Place
#include
directives at the top of the file.
- Follow the .NET naming conventions. Use
PascalCase
for public members andcamelCase
for private members. - Use XML documentation comments for public methods and classes.
- Keep lines of code to a maximum of 120 characters.
- Use
lowerCamelCase
for variable and function names. - Prefer
const
andfinal
for variables when applicable. - Organize imports into three sections: Dart SDK, third-party packages, and local files.
- Use
Widgets
to build the UI. Keep the business logic separate. - Follow the
Material Design
guidelines for consistency. - Utilize
StatelessWidget
andStatefulWidget
appropriately.
- Use
camelCase
for variable and method names, andPascalCase
for class names. - Use Javadoc comments for public methods and classes.
- Follow the
Java Code Conventions
for formatting.
- Use
camelCase
for variable names andPascalCase
for classes. - Use
const
andlet
instead ofvar
for variable declarations. - Follow
ESLint
rules for consistent code style.
- Use
camelCase
for variable and function names. - Use
PascalCase
for class names. - Utilize
data classes
for simple data holding.
- Use
camelCase
for variable names andPascalCase
for class names. - Follow the
PSR-1
andPSR-2
standards for coding style. - Use
PHPDoc
for documentation.
- Follow the
PEP 8
style guide for Python code. - Use
snake_case
for variable and function names. - Keep lines to a maximum of 79 characters.
- Use
snake_case
for method and variable names. - Use
PascalCase
for class names. - Follow the
Ruby Style Guide
for formatting.
- Use
snake_case
for variable and function names. - Use
CamelCase
for struct and enum names. - Follow the
Rust Style Guide
for best practices.
- Use
camelCase
for variable names andPascalCase
for class names. - Utilize interfaces for type definitions.
- Keep code clean and maintainable by following
TypeScript
best practices.
Testing is crucial for ensuring code quality. Follow these standards:
- Write unit tests for all functions and classes.
- Use a testing framework appropriate for your language (e.g.,
JUnit
for Java,pytest
for Python). - Aim for at least 80% code coverage.
Implementing Continuous Integration and Continuous Deployment (CI/CD) helps automate the development process. Follow these practices:
- Use a CI/CD tool (e.g., GitHub Actions, Jenkins) to automate builds and tests.
- Run tests on every pull request to ensure code quality.
- Deploy to production only after passing all tests.
We welcome contributions to improve this repository. To contribute:
- Fork the repository.
- Create a new branch for your feature or fix.
- Make your changes and commit them.
- Submit a pull request.
Please ensure that your contributions follow the coding standards outlined in this repository.
This project is licensed under the MIT License. See the LICENSE file for details.
For the latest updates and downloadable files, please check our Releases section. Here, you can find versioned releases that you can download and execute.
Thank you for checking out the Code Style Guidelines repository! Together, we can maintain high-quality code and foster a collaborative environment at UnifiedBits. Happy coding!