//STYLE: Space out mathematical expressions

## Math can be coded very legibly

Many beginning coders scrunch up all the math in a line in order to save keystrokes:

`var airResistance=coefficientOfDrag*0.5*airDensity*Math.pow(velocity,2);`

And, by gosh, it does save space!

But it is also illegible and miserable to debug.

Good math code follows this simple rule:

## Leave at least one space between each number, symbol, or variable name

So at a minimum, the code above becomes:

``` var airResistance = coefficientOfDrag * 0.5 * airDensity * Math.pow( velocity, 2 ); ```

But it is even easier to debug this:

``````var airResistance	= coefficientOfDrag
* 0.5
* airDensity
* Math.pow( velocity, 2 );``````

Are the following expressions using good, legible programming style?

• `var area = length * width;`

• `var circumference=Math.PI*radius*2;`

• `var hitPoints = characterLevel*2;`

• `var currentPositionX = oldPositionX + (3*speed);`

• ``` var areaOfTrapezoid = ( lengthOfShortBase + lengthOfLongBase ) * ( height / 2 ); ```

``````var surfaceAreaOfRectangularPrism	= 2 * ( height * width )
• `var V = Math.PI * Math.pow( r, 2 );`