Variables and Data Types

Daniel Cermak-Sassenrath · CRC Press eBooks · 2024

This chapter introduces variables. It explains what variables are, what can be done with them, what data types are and why they are useful. It also discusses what Magic Numbers are and why they should be avoided. Several examples are given of bugs in popular games that are (likely) caused by mismatches of values with data types, the most (in-) famous probably being Nuclear Gandhi in Civilization . The formalities and technicalities of declaring and assigning variables are also described. Various naming conventions are presented and discussed based on practical considerations. The most essential variables that are used by Processing and are automatically available are listed (such as width and height ).

Cited by 2 works. doi:10.1201/9781003345916-4

Authors