- Choose an indentation size: Common choices are 2 or 4 spaces. Some styles use tabs, but spaces are generally more consistent across editors.
- Indent each new code block: Inside any set of
{ }
, increase the indentation level by one. When you exit that block, decrease the indentation level.
Example (indenting 4 spaces):