Learn Ruby
Variables
5.8
Lesson

Why spaces in variable assignment

Let’s look at two styles of variable assignment. The first style has no spaces before and after =. The second style has one space before and after =.

In programming we prefer the second style because it makes it easier to read code.

For computers there is no difference between the first style and the second style. For computers it is the same code.