Home
1.
Project best practices
❱
1.1.
Structure your code
1.2.
Naming conventions
1.3.
Format the code
1.4.
Logging
1.5.
Documenting the source code
1.6.
Configuration management
1.7.
Dependency management
2.
Language best practices
❱
2.1.
Represent optionality
2.2.
Handle nil values
2.3.
Use precise types
2.4.
Work with value ranges
2.5.
Avoid unnecessary type casts
2.6.
Using included record parameters
2.7.
Use expression-bodied functions
2.8.
Use tuples to return multiple values
2.9.
Return errors and use the check
2.10.
Avoid unnecessary usage of panic
2.11.
Use open vs closed records
2.12.
Simplify mapping constructor
2.13.
Avoid unnecessary objects
2.14.
Using constants
2.15.
Handle unions of string constants
2.16.
Handle unions of integer constants
2.17.
Generate string by concatenating values
2.18.
Avoid parentheses in if statement
2.19.
Using match statement
2.20.
Using query expressions for iterations
3.
Common best practices guide
❱
3.1.
Use early returns
3.2.
Avoid redundant variables
3.3.
Avoid unnecessary comments
3.4.
Wrap code at 120 characters
3.5.
Use proper commit messages and PR titles
4.
Learning resources
5.
Ballerina FAQ
6.
Ballerina library samples
❱
6.1.
Twilio
Light (default)
Rust
Coal
Navy
Ayu
Ballerina Programming Language Best Practices Guide
Common best practices guide
These are common some best practices which are common for any language.
Use early returns
Avoid redundant variables
Avoid unnecessary comments
Wrap code at 120 characters
Use proper commit messages and PR titles