- Example: In y = 4t + 10 the 10 is a constant term.
- Rename 10 to BASE_FREQUENCY if the context involves waves.
| Field | Example Constant | Typical Use |
|---|---|---|
| Physics | Gravitational constant (G) | Defines strength of gravitational attraction |
| Finance | Interest rate (r) | Used in compound interest calculations |
| Programming | PI approximation | Provides accuracy in geometry modules |
| Engineering | Speed of light (c) | Foundation for electromagnetic equations |
- Keep constants in dedicated configuration files rather than scattering them throughout source code.
- Use clear, consistent naming conventions (e.g., UPPER_SNAKE_CASE for environment constants).
- Document each constant’s purpose and allow changes only through controlled processes.
- Store them in read-only memory where possible to protect against accidental modifications.
- When collaborating, include version control tags or commit messages that note updates to important constants.