- Naming Conventions:
- Variables and functions:
snake_case
(variable_name
) - Classes:
PascalCase
(ClassName
) - Constants:
UPPERCASE
(CONSTANT_VALUE
)
- Variables and functions:
- Imports: Group imports in the order of standard library, third-party, and then local imports, each group separated by a blank line.
- PEP 8: Follow the PEP 8 style guide for coding conventions.
- Naming Conventions:
- Variables and functions:
camelCase
for internal,PascalCase
for exported names (variableName
,FunctionName
) - Acronyms capitalized (
HTTPServer
,URLParser
)
- Variables and functions:
- Formatting: Use
gofmt
to automatically format your code. - Error Handling: Prefer explicit error handling over exceptions.
- Concurrency: Use Goroutines and channels for concurrent tasks.
- Naming Conventions:
- Components:
PascalCase
(MyComponent
) - Instances and functions:
camelCase
(myInstance
,myFunction
)
- Components:
- Hooks: Use hooks for local component state and lifecycle (e.g.,
useState
,useEffect
). - Components: Prefer functional components over class components.
- Props: Destructure props for clarity and brevity in functional components.
- Naming Conventions:
- Tables and columns:
snake_case
is common, but conventions can vary (table_name
,column_name
) - Avoid reserved keywords for identifiers.
- Tables and columns:
- Queries:
- Use explicit
JOIN
clauses instead of implicit joins for clarity. - Capitalize SQL keywords (
SELECT
,FROM
,WHERE
) for readability.
- Use explicit
- Indexes: Use indexes strategically for columns often used in
JOIN
,WHERE
,ORDER BY
, andGROUP BY
clauses to improve query performance.