Abbreviations in programming languages

Ever wonder where those wonderful abbreviations in C came from? You know += ? If you delve into Algol 68, you will notice some of them there.

Until Algol 68 datatypes were mostly indicated as keywords such as integer, real,  character. As the new kid on the block, Algol 68 introduced abbreviations that unlike PL/I were not optional. So integer became int, character became char, Boolean became bool (pity C didn’t make booleans integral from day one). For the novice programmer, this does tend to make programs more challenging to read. It also coined the term void. Algol 68 also allowed datatypes to be lengthened and shortened, in a way which will be inherently familiar to C programmers:

long real, long int, short real, short int, long long real, long long int

See the similarity? Of course it doesn’t end there. Algol 68 also allowed a form of optimization as it relates to operators:

sum plusab x

Look familiar? This is the “plus and becomes” operator, which can also be written as +:=, and in C as += . It’s like a piece of assembler jumping into your code… and the presence of this in the code was meant to signal the compiler that this code can be optimized. There were others of course: minusab, timesab, divab, and overab/modab for integers.


2 thoughts on “Abbreviations in programming languages

  1. nevillednz says:

    According to Steven Bourne, primordial C language used PL/I like declarations e.g. “dcl li fixed bin(63,0) init(63)” but this was replaced in C with Algol68 convention of “long int li” that we now know and love. However Algol68 has “long bits” (for packing bool) and “long bytes” (for packing char), but no “long char” for Unicode. 😦 … But Algol68 gives C the “void” type (originally a stack optimisation in C) and Algol68 originated C’s “struct” keyword…

  2. nevillednz says:

    I forgot to mention… Algol68 has the +:= operator (PLUSAB: plus and becomes) to add a suffix to a string, and then the +=: operator (PLUSTO: plus to) to add a prefix to a string. Weird…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s