Game Development Reference
In-Depth Information
Programming such games was done in an Assembler language. Assembler languages were the
first imperative programming languages. Each type of processor had its own set of Assembler
instructions, so these Assembler languages were different for each processor. Because such
a limited amount of memory was available, game programmers were experts at squeezing out
the last bits of memory and performing extremely clever hacks to increase efficiency. The final
programs, though, were unreadable and couldn't be understood by anyone but the original
programmer. Fortunately that wasn't a problem, because back then, games were typically
developed by a single person.
A bigger issue was that because each processor had its own version of the Assembler language,
every time a new processor came around, all the existing programs had to be completely rewritten
for that processor. Therefore, a need arose for processor-independent programming languages.
This resulted in languages such as Fortran (FORmula TRANslator) and BASIC (Beginners' All-
purpose Symbolic Instruction Code). BASIC was very popular in the 1970s because it came with
early personal computers such as the Apple II in 1978, the IBM-PC in 1979, and their descendants.
Unfortunately this language was never standardized, so every computer brand used its own dialect
of BASIC.
Note The fact that I made the effort to identify the paradigm of imperative programming languages implies
that there are other programming paradigms that aren't based on instructions. Is this possible? What does
the processor do if it doesn't execute instructions? Well, the processor always executes instructions, but that
doesn't mean the programming language contains them. For example, suppose you build a very complicated
spreadsheet with many links between different cells in the sheet. You could call this activity programming
and call the empty spreadsheet the program , ready to process data. In this case, the program is based not on
instructions but on functional links between the cells. In addition to these functional programming languages ,
there are languages based on propositional logic—the logical programming languages —such as Prolog.
These two types of programming languages together form the declarative paradigm .
Procedural Programming: Imperative + Procedures
As programs became more complex, it was clear that a better way of organizing all these
instructions was necessary. In the procedural programming paradigm , related instructions are
grouped together in procedures (or functions , or methods , the latter of which is the more common
modern name). Because a procedural programming language still contains instructions, all
procedural languages are also imperative.
One well-known procedural language is C. This language was defined by Bell Labs, which was
working on the development on the Unix operating system at the end of the 1970s. Because an
operating system is a very complicated kind of program, Bell Labs wanted to write it in a procedural
language. The company defined a new language called C (because it was a successor of earlier
prototypes called A and B). The philosophy of Unix was that everybody could write their own
extensions to the operating system, and it made sense to write these extensions in C as well. As a
result, C became the most important procedural language of the 1980s, also outside the Unix world.
 
Search WWH ::




Custom Search