//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 );

Test your habits

Are the following expressions using good, legible programming style?