Game Development Reference
In-Depth Information
Each programming language provides a basic set of elements, which describes data
and the processes and transformations which can be applied to them, also called
primitives of that language.
A very important element of programming languages is their syntax. Most program-
ming languages are textual and their syntax includes words, numbers, and punctu-
ations. However, there are other programming languages that make use of a graph-
ical approach, where programs are created by a visual representation of symbols,
for example, a flowchart.
The syntax of a program defines the possible combinations of symbols that constitu-
te a syntactically correct program.
Another way to differentiate between programming languages is whether they re-
quire static typing or allow dynamic typing .
Static typing means that all expression types of that language are predetermined be-
fore the program is executed. If an expression expects a string data type and you
pass them integers, the output is an error message.
In the category of static typing, we can also distinguish between programming lan-
guages that require types to be specified at the beginning of a program (variable de-
clarations) and languages which can infer the type of data passed to a function by
the context in which the operations occurs.
A mainstream language such as C++ is an example of statically-typed languages,
while C# (C sharp) and Java make use of variable declarations, but can also infer
data types in limited cases.
On the other hand, dynamically-typed languages do not require types to be explicitly
defined at some point of a program and allow a variable to refer to different types of
data at different points of the program's execution. This could be both an advantage
and a problem; it allows a more flexible approach to programming, but it also makes
debugging difficult. Lisp, Perl, Python, and JavaScript are examples of dynamically-
typed languages.
Orthogonal to the dichotomy between static and dynamic typing, there is the one
between strong and weak typing.
Search WWH ::




Custom Search