top | item 42041805

(no title)

wwalexander | 1 year ago

I believe this stems from C originally only having 8 significant characters for identifiers.

discuss

order

cesarb|1 year ago

Not only that, but screen space was really limited back then; it was not uncommon to develop on terminals with as low as 80 columns and 24 lines. Having shorter names meant more of the code could fit on the screen at the same time.

rbanffy|1 year ago

The limited size helps with keeping the code short and simple. ;-)

marssaxman|1 year ago

I still develop on a terminal with 80 columns, to this day!

...but it has 96 rows, and there are five of them, side by side across my monitor. Definitely an improvement! - but I still prefer not to have long rambling Java-style identifiers.

layer8|1 year ago

That’s only for external identifiers (the one the linker sees), and it’s only six characters. This limit comes from FORTRAN, and in turn comes from the world of 36-bit word mainframes. Those machines didn’t have bytes, only words. Words could represent numbers, or up to 6 characters (in a 6-bit character set, no lowercase letters).

Internal identifiers and macro names had a lower limit of 31 significant characters in C.

The more relevant original reason for short identifiers is that code completion wasn’t a thing, and to a lesser extent that screens were at most 80 characters wide.

emmelaich|1 year ago

The limit for syscalls in early Unix seems to be five though. I forget why.

Hence, famously, "creat" instead of "create"

high_na_euv|1 year ago

Majority of those above are above 8 char length.