O'Reilly logo

3D Game Programming for Teens, Second Edition by Eric Grebler, Maneesh Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Developing Style

Everyone has his or her own style of coding; it’s an inevitable fact. No two people enjoy their code the same way. Basically, to create a style for yourself, you just have to discover what is right for you and stick with it. Lesson one in the style primer: Be Consistent.

Let’s start out with the most basic form of style: white space. Examples of white space are tabs, spaces, and new lines. Under most circumstances, you can add as much white space as you like to the beginning and end of most lines. White space can also be included between test commands (such as < and >) and what is being tested, as in Figure 4.1.

Figure 4.1. White space.

White Space and Indentation

The easiest way to see the use of white space is with examples. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required