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

Function and Variable Names

Naming your variables correctly can help solve a lot of problems in programs. Every once in a while you might come across the problem of not knowing what a variable does. You will have to backtrack and follow your program from the beginning. A way to solve this problem, however, is to name your variables a very easy-to-understand name. This can help reduce, if not eliminate, later forgetfulness.

Names

When declaring and defining variables, make sure you come up with a name that easily describes what the variable does. For example, when writing the Hello World program, I could have easily named the variable anything. I could have chosen names like

i$

row$

howareyou$

_123$

hellostr$

but there is a reason I didn’t. For ...

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