Spacing for Readability

Because Raptor is a graphical language, Raptor programs tend to rely less on words than most text-based languages do.  However, how programs are typed can affect our understanding of what they do.  In particular, careful use of spacing can make programs more readable.

 

Spacing in Raptor Text Boxes

 

As pointed out in Names:  Rules and Suggestions, spaces are not allowed in the middle of a name.  However, spaces are allowed between different elements the user types into a text box.  Often, adding spaces can make the program more readable.  For example, spaces can be added between arguments in a procedure call:

 

Display_Text(100,100,"Score: "+Score,Blue)  

vs.  

Display_Text(100, 100, "Score: " + Score, Blue)

 

 

In the diamond for a selection:

 

count=5

vs.

count = 5

 

 

In a math expression:

 

Fahrenheit=Celcius*9/5+32

vs.

Fahrenheit = (Celcius * (9 / 5)) + 32

 

 

In all the above cases, the second version is much more readable.