Programming Language Features
Table of Contents
The designers of computer programming languages have to address a myriad of problems. It can be informative to see the different choices made. The notes below show in tabular form some of the solutions chosen.
Approximate dates are given for the designs and they are presented in chronological order. This helps to illustrate how a given language design changed and how different options were chosen over time.
Comment delimiters
|
Identifier names
|
Based numeric literals
|
Notes
- The assembler Macro-11 1970 uses octal as the default base. All the other languages use decimal as the default.
- In B 1969 the text 010 means 8 but note that, bizarrely, 09 is also accepted and means 9. See [[octal-zero-prefix]] for related information.
- Ada 1983 allows an exponent after the final #. Base and exponent are always in decimal.
Type of numeric literals
|
String delimiters
|
Notes
- Perl 1977 allows variable substitution in double-quoted strings.
Character delimiters
|
Notes
- C 1975 and C++ 1983 use single quotes (') to delimit a character constant such as 'a' as they distinguish between a single character and a string of one character. A single character occupies one cell. Conversely, a string of one character has a trailing zero and occupies two cells.
Character IDs
The number after each character name is the ordinal in ASCII.
|
Notes
- C 1975 allows 1 to 3 octal digits to specify a character. The sequence \0 (not followed by a digit) indicates a null character.
Embedded characters
When certain characters are embedded in string literals they require escaping.
|
Basic arithmetic operations
|
Notes
- In Basic 1964 the up arrow (^) takes the absolute value of the left operand before raising it to a power.
Addition operations between
|
Subtraction operations between
|
Multiplcation operations between
|
Division operations
|
Integer remainder operations
|
Notes
- The C 1975 manual states the current implementation of % has the same sign as the dividend. This suggests it is not part of the language design.
Division operations between
|
Relational operators
|
Boolean operators
|
Bitwise in-place operators
|
Bitwise movement operators
|
Set operations
|
Type support
|
Numeric types
|
References
Sources in date order for the information presented above.
- Fortran IV 1962
- Basic 1964 - The original Dartmouth College language
- BCPL 1967 - This page lists various sources. See, for example, the PDF file
- C 1975
- Ada 1983
- Java 1995: Java in a Nutshell, O'Reilly
page revision: 2, last edited: 27 Oct 2014 18:51