Skip to content

Commit 53c7491

Browse files
Add files via upload
1 parent 558d456 commit 53c7491

File tree

5 files changed

+311
-0
lines changed

5 files changed

+311
-0
lines changed

f.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# F# Style Guide
2+
3+
[![Buy Me A Coffee](https://srv-cdn.himpfen.io/badges/buymeacoffee/buymeacoffee-flat.svg)](https://tinyurl.com/2h9aktmd)   [![Ko-Fi](https://srv-cdn.himpfen.io/badges/kofi/kofi-flat.svg)](https://tinyurl.com/d4xnrptz)   [![PayPal](https://srv-cdn.himpfen.io/badges/paypal/paypal-flat.svg)](https://tinyurl.com/mr22naua)   [![Stripe](https://srv-cdn.himpfen.io/badges/stripe/stripe-flat.svg)](https://tinyurl.com/e8ymxdw3)
4+
5+
## Naming Conventions
6+
- Use PascalCase for module names and type names.
7+
- Use camelCase for function names, method names, and variable names.
8+
- Use uppercase abbreviations for acronyms in names (e.g., HTTP, XML).
9+
10+
## Indentation and Formatting
11+
- Use 4 spaces for indentation (no tabs).
12+
- Limit line length to 100 characters.
13+
- Break long lines with appropriate indentation.
14+
- Put opening braces on the same line as the declaration.
15+
16+
## Commenting
17+
- Use `///` for XML documentation comments.
18+
- Use `//` for single-line comments.
19+
- Use `(* ... *)` for multi-line comments.
20+
21+
## Pattern Matching and Discriminated Unions
22+
- Use pattern matching instead of `if-then-else` chains whenever possible.
23+
- Define discriminated union cases in uppercase.
24+
- Use indentation to make the pattern matching code readable.
25+
26+
## Immutable Data and Immutability
27+
- Prefer immutability whenever possible.
28+
- Use `let` bindings for immutable values.
29+
- Avoid using mutable variables.
30+
31+
## Function Composition
32+
- Use the `|>` operator for function composition.
33+
- Prefer function composition over nested function calls.
34+
35+
## Error Handling
36+
- Use the `Result<'T, 'TError>` type for error handling.
37+
- Use `Option<'T>` for optional values.
38+
- Avoid throwing exceptions for normal control flow.
39+
40+
## Concurrency and Asynchronous Programming
41+
- Use `async` and `await` for asynchronous programming.
42+
- Use `Task<'T>` for asynchronous computations.
43+
- Use `Async<'T>` for asynchronous workflows.
44+
45+
## Miscellaneous
46+
- Avoid unnecessary type annotations.
47+
- Use meaningful names for variables and functions.
48+
- Write concise and readable code.
49+
- Follow functional programming principles.
50+
- Use whitespace to improve code readability.

julia.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Julia Programming Style Guide
2+
3+
[![Buy Me A Coffee](https://srv-cdn.himpfen.io/badges/buymeacoffee/buymeacoffee-flat.svg)](https://tinyurl.com/2h9aktmd) &nbsp; [![Ko-Fi](https://srv-cdn.himpfen.io/badges/kofi/kofi-flat.svg)](https://tinyurl.com/d4xnrptz) &nbsp; [![PayPal](https://srv-cdn.himpfen.io/badges/paypal/paypal-flat.svg)](https://tinyurl.com/mr22naua) &nbsp; [![Stripe](https://srv-cdn.himpfen.io/badges/stripe/stripe-flat.svg)](https://tinyurl.com/e8ymxdw3)
4+
5+
## Naming Conventions
6+
7+
- Use lowercase letters and underscores for variable and function names: `my_variable`, `my_function`.
8+
- Use descriptive and meaningful names.
9+
- Avoid single-character variable names except for loop counters or generic iterators.
10+
- Use camel case for struct and type names: `MyStruct`, `MyType`.
11+
- Prefix boolean variables with "is" or "has": `is_ready`, `has_data`.
12+
13+
## Formatting
14+
15+
- Use 4 spaces for indentation (no tabs).
16+
- Limit lines to 80 characters or less.
17+
- Use spaces around operators and after commas, e.g., `x = 10 + y`, `my_function(arg1, arg2)`.
18+
- Put a space after a comma in function arguments list.
19+
- Use consistent and clear spacing for function calls and definitions.
20+
21+
## Comments
22+
23+
- Use comments to explain complex logic or clarify code.
24+
- Write comments in complete sentences.
25+
- Avoid obvious or redundant comments that merely repeat the code.
26+
27+
## Function and Macro Definitions
28+
29+
- Add a space between function or macro name and opening parenthesis: `my_function(arg1, arg2)`.
30+
- Use lowercase for function and macro names.
31+
- Separate arguments with commas and align them vertically if they span multiple lines.
32+
- Use a single space after the comma separating a function argument.
33+
34+
## Control Flow
35+
36+
- Use `if`, `elseif`, and `else` for conditional statements.
37+
- Put spaces around operators within conditions: `if x > 0`.
38+
- Use `end` to close conditional blocks.
39+
- Use `for` and `while` loops for iteration.
40+
- Use `break` to exit loops prematurely.
41+
- Use `continue` to skip the current iteration in a loop.
42+
43+
## Error Handling
44+
45+
- Use `try`, `catch`, and `finally` for error handling.
46+
- Be specific with error types when catching exceptions.
47+
- Avoid using `catchall` unless absolutely necessary.
48+
49+
## Documentation
50+
51+
- Use docstrings to document functions, macros, and types.
52+
- Write clear and concise descriptions of the purpose, arguments, and return values.
53+
- Include examples and provide explanations for complex behaviors.
54+
- Use Markdown formatting in docstrings for formatting and readability.
55+
56+
## Testing
57+
58+
- Write tests for your code using the `Test` module or a testing framework.
59+
- Separate tests into logical sections and provide descriptive names.
60+
- Include both positive and negative test cases.
61+
- Ensure tests are reproducible and independent of each other.
62+
63+
## Miscellaneous
64+
65+
- Follow the official Julia style guide unless specified otherwise.
66+
- Use type annotations for function arguments and return types when it improves clarity.
67+
- Use whitespace to improve code readability.
68+
- Refactor code to improve clarity and maintainability.
69+
- Keep lines of code concise and avoid excessive nesting.
70+

python.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Python Programming Style Guide
2+
3+
[![Buy Me A Coffee](https://srv-cdn.himpfen.io/badges/buymeacoffee/buymeacoffee-flat.svg)](https://tinyurl.com/2h9aktmd) &nbsp; [![Ko-Fi](https://srv-cdn.himpfen.io/badges/kofi/kofi-flat.svg)](https://tinyurl.com/d4xnrptz) &nbsp; [![PayPal](https://srv-cdn.himpfen.io/badges/paypal/paypal-flat.svg)](https://tinyurl.com/mr22naua) &nbsp; [![Stripe](https://srv-cdn.himpfen.io/badges/stripe/stripe-flat.svg)](https://tinyurl.com/e8ymxdw3)
4+
5+
This style guide provides guidelines for writing Python code that is readable, maintainable, and consistent.
6+
7+
## Table of Contents
8+
1. [Introduction](#introduction)
9+
2. [Naming Conventions](#naming-conventions)
10+
3. [Code Formatting](#code-formatting)
11+
4. [Comments](#comments)
12+
5. [Function and Method Definitions](#function-and-method-definitions)
13+
6. [Imports](#imports)
14+
7. [Exceptions](#exceptions)
15+
8. [Whitespace](#whitespace)
16+
9. [Miscellaneous](#miscellaneous)
17+
18+
## Naming Conventions
19+
- Use `lowercase_with_underscores` for variable and function names.
20+
- Use `CAPITALIZED_WITH_UNDERSCORES` for constants.
21+
- Use `CamelCase` for class names.
22+
- Avoid single-character names, unless they have a well-defined meaning.
23+
- Avoid using reserved keywords as names.
24+
25+
## Code Formatting
26+
- Use 4 spaces for indentation (avoid tabs).
27+
- Limit lines to a maximum of 79 characters.
28+
- Use a single space around operators and after commas.
29+
- Use blank lines to separate logical sections of code.
30+
31+
## Comments
32+
- Use comments to explain non-obvious code behavior.
33+
- Write self-explanatory code that reduces the need for comments.
34+
- Use complete sentences and proper grammar in comments.
35+
36+
## Function and Method Definitions
37+
- Use descriptive names for functions and methods.
38+
- Add a docstring to describe the purpose, inputs, and outputs of the function.
39+
- Limit the number of arguments to keep functions concise.
40+
41+
## Imports
42+
- Import modules on separate lines, grouped in the following order:
43+
1. Standard library imports.
44+
2. Third-party library imports.
45+
3. Local application imports.
46+
- Avoid using wildcard imports (`from module import *`).
47+
48+
## Exceptions
49+
- Catch specific exceptions instead of using a bare `except` clause.
50+
- Avoid catching and swallowing exceptions silently.
51+
52+
## Whitespace
53+
- Use a single blank line to separate logical sections of code.
54+
- Use blank lines sparingly within functions to improve readability.
55+
- Avoid excessive whitespace at the end of lines or empty lines at the end of files.
56+
57+
## Miscellaneous
58+
- Be consistent with the style guide within a project.
59+
- Write code that is easy to understand and maintain.
60+
- Refactor code to improve readability and eliminate code duplication.
61+
62+
---
63+
64+
This style guide is inspired by the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide with a few additional recommendations.

swift.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Swift Style Guide
2+
3+
[![Buy Me A Coffee](https://srv-cdn.himpfen.io/badges/buymeacoffee/buymeacoffee-flat.svg)](https://tinyurl.com/2h9aktmd) &nbsp; [![Ko-Fi](https://srv-cdn.himpfen.io/badges/kofi/kofi-flat.svg)](https://tinyurl.com/d4xnrptz) &nbsp; [![PayPal](https://srv-cdn.himpfen.io/badges/paypal/paypal-flat.svg)](https://tinyurl.com/mr22naua) &nbsp; [![Stripe](https://srv-cdn.himpfen.io/badges/stripe/stripe-flat.svg)](https://tinyurl.com/e8ymxdw3)
4+
5+
## Table of Contents
6+
1. [Naming Conventions](#naming-conventions)
7+
2. [Formatting](#formatting)
8+
3. [Comments](#comments)
9+
4. [Control Flow](#control-flow)
10+
5. [Error Handling](#error-handling)
11+
12+
## Naming Conventions
13+
- Use descriptive names for variables, functions, and types.
14+
- Follow camel case for variable and function names (e.g., `myVariable`, `calculateResult()`).
15+
- Use uppercase camel case for type names (e.g., `MyClass`, `PersonModel`).
16+
- Prefix class properties with `self` to differentiate from method arguments and local variables.
17+
18+
## Formatting
19+
- Indent using 4 spaces.
20+
- Use spaces around operators and after commas.
21+
- Place opening braces on the same line as the associated statement or declaration.
22+
- Place `else` statements on the same line as the closing brace of the previous `if` statement.
23+
24+
## Comments
25+
- Use `//` for single-line comments and `/* ... */` for multi-line comments.
26+
- Write descriptive comments that explain the purpose of the code.
27+
- Avoid excessive commenting for obvious or self-explanatory code.
28+
29+
## Control Flow
30+
- Use `if` and `guard` statements for conditions and early exits.
31+
- Prefer the `for-in` loop for iterating over collections.
32+
- Use `switch` statements for multiple conditions with associated values.
33+
- Use `defer` to clean up resources or perform actions before exiting a scope.
34+
35+
## Error Handling
36+
- Use Swift's `try-catch` mechanism for handling errors.
37+
- Avoid using exceptions for flow control.
38+
- Create custom error types for specific error cases.
39+
- Use `throws` in function declarations to indicate that it can throw an error.
40+

typescript.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# TypeScript Style Guide
2+
3+
[![Buy Me A Coffee](https://srv-cdn.himpfen.io/badges/buymeacoffee/buymeacoffee-flat.svg)](https://tinyurl.com/2h9aktmd) &nbsp; [![Ko-Fi](https://srv-cdn.himpfen.io/badges/kofi/kofi-flat.svg)](https://tinyurl.com/d4xnrptz) &nbsp; [![PayPal](https://srv-cdn.himpfen.io/badges/paypal/paypal-flat.svg)](https://tinyurl.com/mr22naua) &nbsp; [![Stripe](https://srv-cdn.himpfen.io/badges/stripe/stripe-flat.svg)](https://tinyurl.com/e8ymxdw3)
4+
5+
This guide provides a set of guidelines and best practices for writing TypeScript code. Adhering to these standards will improve code readability, maintainability, and collaboration within your project.
6+
7+
## Table of Contents
8+
9+
1. [General Guidelines](#general-guidelines)
10+
2. [Naming Conventions](#naming-conventions)
11+
3. [Types](#types)
12+
4. [Interfaces](#interfaces)
13+
5. [Classes](#classes)
14+
6. [Functions](#functions)
15+
7. [Variables](#variables)
16+
8. [Modules](#modules)
17+
9. [Error Handling](#error-handling)
18+
10. [Formatting](#formatting)
19+
20+
## General Guidelines
21+
22+
- Always use strict mode by enabling the `strict` compiler option.
23+
- Use meaningful and descriptive names for variables, functions, classes, etc.
24+
- Keep lines of code short and concise. Aim for a maximum of 80 characters per line.
25+
- Comment your code to explain complex logic or any non-obvious behavior.
26+
27+
## Naming Conventions
28+
29+
- Use camelCase for variables, functions, and class members.
30+
- Use PascalCase for classes, interfaces, and type names.
31+
- Use uppercase snake case for constants and enum values.
32+
- Prefix interfaces with `I`.
33+
- Use clear and descriptive names, even if it results in longer names.
34+
35+
## Types
36+
37+
- Prefer TypeScript's built-in types (`string`, `number`, `boolean`, etc.) over their JavaScript counterparts (`String`, `Number`, `Boolean`, etc.).
38+
- Use union types (`|`) and intersection types (`&`) when appropriate.
39+
- Avoid using the `any` type whenever possible. Instead, be explicit about the types.
40+
- Use type inference when the type is obvious and doesn't harm readability.
41+
42+
## Interfaces
43+
44+
- Define interfaces for objects or classes that share a common structure.
45+
- Name interfaces using PascalCase.
46+
- Use optional properties (`?`) or default values sparingly.
47+
- Prefer readonly properties where applicable.
48+
49+
## Classes
50+
51+
- Use classes to represent complex data structures or encapsulate behavior.
52+
- Use the `public` modifier explicitly for clarity, as it's the default access modifier.
53+
- Keep the number of properties and methods in a class to a minimum for better cohesion.
54+
- Prefer composition over inheritance, unless there's a strong need for inheritance.
55+
56+
## Functions
57+
58+
- Use arrow functions (`() => {}`) for short, concise functions and when lexical scoping is required.
59+
- Use regular functions (`function () {}`) for methods and when dynamic scoping is needed.
60+
- Prefer explicit return types for functions to enhance readability.
61+
- Use default parameters to provide optional arguments when it makes sense.
62+
63+
## Variables
64+
65+
- Use `const` for values that should not be reassigned.
66+
- Use `let` for variables that can be reassigned.
67+
- Avoid using `var` unless you have a specific reason to use it.
68+
69+
## Modules
70+
71+
- Use ES modules (`import`/`export`) for managing dependencies.
72+
- Prefer named exports over default exports to encourage explicit imports.
73+
- Organize imports in alphabetical order and group them by third-party dependencies and local modules.
74+
75+
## Error Handling
76+
77+
- Use proper error handling techniques, such as `try-catch` blocks, for handling expected errors.
78+
- Throw specific error types instead of generic `Error` objects.
79+
- Avoid swallowing errors by using empty `catch` blocks.
80+
81+
## Formatting
82+
83+
- Use two spaces for indentation. Do not use tabs.
84+
- Use single quotes (`'`) for string literals, unless escaping is necessary.
85+
- Use semicolons at the end of each statement.
86+
- Put spaces around operators (`+, -, *, /, =, ===, etc.`) for improved readability.
87+
- Break long statements or expressions into multiple lines for better readability.

0 commit comments

Comments
 (0)