Comparison of Programming Languages
m (→Features: fixed bad styling) |
m (removed whining comments; I figured out a solution to my styling woes) |
||
Line 21: | Line 21: | ||
The following tables compares major features of the Unity programming languages. | The following tables compares major features of the Unity programming languages. | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 82: | Line 81: | ||
=== [http://en.wikipedia.org/wiki/Integer_(computer_science) Integer] === | === [http://en.wikipedia.org/wiki/Integer_(computer_science) Integer] === | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 133: | Line 131: | ||
=== [http://en.wikipedia.org/wiki/Floating_point Floating Point] === | === [http://en.wikipedia.org/wiki/Floating_point Floating Point] === | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 160: | Line 157: | ||
=== Other Types === | === Other Types === | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 195: | Line 191: | ||
=== [http://en.wikipedia.org/wiki/Array_data_type Array] === | === [http://en.wikipedia.org/wiki/Array_data_type Array] === | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 227: | Line 222: | ||
=== Other Types === | === Other Types === | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 251: | Line 245: | ||
== Basic Unity-Specific Types == | == Basic Unity-Specific Types == | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 268: | Line 261: | ||
== Declarations == | == Declarations == | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 287: | Line 279: | ||
=== Conditional Statements === | === Conditional Statements === | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 304: | Line 295: | ||
=== Loop Statements === | === Loop Statements === | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 321: | Line 311: | ||
=== Exceptions === | === Exceptions === | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 338: | Line 327: | ||
=== Other Flow Control Statements === | === Other Flow Control Statements === | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 355: | Line 343: | ||
== Functions == | == Functions == | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- | ||
Line 372: | Line 359: | ||
== Type Conversions == | == Type Conversions == | ||
− | |||
{| {{wikitable}} | {| {{wikitable}} | ||
|- | |- |
Revision as of 05:41, 15 August 2009
This is a comparison of the features and instructions of the three high-level programming languages offered by Unity: JavaScript, C#, and Boo.
Contents |
Conventions of This Article
The bold is the literal code. The non-bold is interpreted by the reader. Statements in guillemets (« … ») are optional. tab indicates a necessary indent.
The following tables compare code differences of the Unity programming languages. See also the Comparison of Programming Languages for general information.
Features
The following tables compares major features of the Unity programming languages.
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
Paradigm(s) | |||
Standardized Variation? | Yes | Yes, ECMA, ISO ECMA-334; ISO/IEC 23270:2006 | No |
Type Strength | strong | strong | strong1 |
Type Safety | safe | safe | safe |
Expression of Types | implicit with optional explicit typing | explicit | implicit with optional explicit typing |
Compatibility Among Composite Types | name-based | ||
Type Checking | static with optional dynamic typing | static with optional dynamic typing | static with optional dynamic typing |
1 Normally Javascript in Unity uses type inference to statically type all variables when possible, in cases where the type is not explicitly stated. Dynamic typing can be forced if desired, and, in certain circumstances, dynamic typing is used unless forced otherwise. Use of the "#pragma strict" directive disables all dynamic typing.
Type Identifiers
Integer
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
8 bit (byte) Signed | sbyte | sbyte | |
8 bit (byte) Unsigned | byte | byte | byte |
16 bit (short integer) Signed | short | short | short |
16 bit (short integer) Unsigned | ushort | ushort | |
32 bit Signed | int | int | int |
32 bit Unsigned | uint | uint | |
64 bit (long integer) Signed | long | long | long |
64 bit long integer) Unsigned | ulong | ulong |
Floating Point
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
Single Precision | single | float | float |
Double Precision | double | double | double |
Arbitrarily Precise (bignum) | decimal |
Other Types
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
Text Character | N/A | char | char |
Text String | string | string | String |
Boolean) | bool | bool | boolean |
Object/Universal) | object | object | Object |
Derived Types
Array
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
one-dimensional fixed size array | (type) | type[size] | type[size] |
multi-dimensional fixed size array | type[size1, size2,...] | type[size1, size2,...] (note: currently these types of arrays can be created implicitly and used, but cannot be created explicitly) | |
one-dimensional dynamic size array | List | System.Collections.ArrayList or System.Collections.Generic.List<type> |
Array or System.Collections.ArrayList |
multi-dimensional dynamic size array |
Other Types
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
Record Simple Composite Types | struct name {type name;...} | ||
Enumeration Simple Composite Types |
enum condition: |
Basic Unity-Specific Types
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
Declarations
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
Flow Control
Conditional Statements
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
Loop Statements
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
Exceptions
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
Other Flow Control Statements
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
Functions
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|
Type Conversions
Language | Boo | C# | UnityScript/JavaScript |
---|---|---|---|