Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 621 Bytes

inconsistent-formatting.md

File metadata and controls

27 lines (19 loc) · 621 Bytes

Inconsistent Formatting

What It Looks Like

def foo(bar)
1 + bar
end
 def baz kludge
   2 + kludge
 end

Why It Hurts

Consistency is important. By making things that are similar appear similar, important differences stand out more. It is also easier to read a code style you encounter a lot, so being consistent with formatting helps you read code more quickly and easily.

How To Fix It

Use Rearrange Whitespace.

Caveats

Extremely rigid formatting rules can make code less readable in certain circumstances. Balance consistency with readability.