2.14 Code Conventions and Style

2.14.1 Formatting

  • Indentation: 4 spaces (by convention).
  • Use rustfmt to automatically format code.

2.14.2 Naming Conventions

  • Variables and Functions: snake_case
  • Constants and Statics: SCREAMING_SNAKE_CASE
  • Types and Traits: PascalCase
  • Crates and Modules: snake_case

2.14.3 Comparison with C

  • C has similar conventions, but practices vary more widely.
  • Consistency is encouraged but not enforced in C.