Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 1.13 KB

File metadata and controls

35 lines (22 loc) · 1.13 KB

Naming Convention

A naming convention is a set of rules used to standardize how code is written.

CapitalCase

Structs, traits, and enums are CapitalCase which means each word has a capitalized first letter. The fields inside a struct should be snake_case and CapitalCase inside an enum.

{{#include ../../../code/language/style-guide/letter_casing/src/lib.sw:structures}}

snake_case

Modules, variables, and functions are snake_case which means that each word is lowercase and separated by an underscore.

Module name:

{{#include ../../../code/language/style-guide/letter_casing/src/lib.sw:module}}

Function and variable:

{{#include ../../../code/language/style-guide/letter_casing/src/lib.sw:function_case}}

SCREAMING_SNAKE_CASE

Constants are SCREAMING_SNAKE_CASE which means that each word in capitalized and separated by an underscore.

{{#include ../../../code/language/style-guide/letter_casing/src/lib.sw:const}}