Coding/AI Best Practices
Coding/AI Best Practices
Coding standards and style guides
- Write for humans, not machines - Code should be readable like a story.
- Good code doesn’t need to be commented!
- Add documentation comments and types where helpful.
- Use semantic namings for variables - think from the dev perspective.
- For example: bot.run() instead of bot.run_bot()
- Avoid magic numbers or strings. Extract them as constants. Use enums. Don’t hardcode vars.
- Be consistent in formatting and styling your code.
- If you doubt your skills - ask LLMs and seniors to check.
- If you use LLMs to write code, make sure you understand its output.
- Don’t share private information about the project with LLMs.
- Python writing style guide to follow (from google): https://google.github.io/styleguide/pyguide.html
- When adding a TODO item in code, use the format:
TODO: {Issue Type}/{Issue ID}: {Short Description}. If the issue is not in the same repository, add a link or full reference to the repository.
AI Usage Policy for Coding
Core Principles
- Use it when it helps, but not more.
- Turn off data collection and do not use AI that is collecting data from your prompts. Especially for AI-integrated editors.
- Do not rely on AI’s expertise to make architectural decisions (better to discuss major decisions with others).
- AI-generated code must be reviewed for maintainability, efficiency, and alignment with coding standards.
- You are fully responsible for the final code output, even when using LLMs.
- Never input sensitive information into AI tools. This includes API keys, passwords, customer data, proprietary algorithms, etc.
Acceptable Use
- exploring different approaches and learning complex concepts.
- improving productivity (e.g., code completion, refactoring, bug detection).
- generating comments and docstrings, but not general documentation. AI generates too much meaningless words and you will be punished for creating such documentation.
Prohibited Use
- submitting LLM’s output without understanding, review and modification.
- delegating architectural decisions, complex business logic, or entire feature development without oversight.
- sharing data that should never be shared anywhere in the internet.
- using AI without understanding of programming, frameworks and coding best practices.