Code Standards
General Principles
- Clarity over cleverness: Write code that is easy to understand
- Consistent naming: Follow established naming conventions
- Error handling: Always handle errors appropriately
- Documentation: Document complex logic and public APIs
Language-Specific Guidelines
Python
Go
API Design
RESTful Principles
Follow REST conventions for API endpoints:Request/Response Format
Always use consistent JSON formatting:Testing Standards
Unit Tests
Write comprehensive unit tests:Integration Tests
Performance Guidelines
Optimization Principles
- Profile before optimizing: Use profiling tools to identify bottlenecks
- Cache appropriately: Cache model weights and frequent computations
- Batch operations: Process multiple requests together when possible