4 ms·
I believe this stems from C originally only having 8 significant characters for identifiers.
by wwalexander 2y ago
I believe this stems from C originally only having 8 significant characters for identifiers.
- cesarb 2y agoNot 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 2y agoThe limited size helps with keeping the code short and simple. ;-)
- kps 2y agoHistorically there was a bifurcation between scientific/technical computing and business computing. The former wanted to write something close to E = mc², while the latter wanted `MULTIPLY MASS-IN-GRAMS TIMES SPEED-OF-LIGHT-IN-A-VACUUM-IN-METERS-PER-SECOND TIMES SPEED-OF-LIGHT-IN-A-VACUUM-IN-METERS-PER-SECOND GIVING ENERGY-IN-JOULES`. With the dotcom boom, the last vestiges of the old republic were finally swept away, and now even C programmers get slapped for writing `c`.
- marssaxman 2y agoI 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.
- high_na_euv 2y agoMajority of those above are above 8 char length.
- winocm 2y agoHere’s a fun link: https://stackoverflow.com/questions/38035628/c-why-did-ansi-only-specify-six-characters-for-the-minimum-number-of-significa https://stackoverflow.com/questions/38035628/c-why-did-ansi-...
- layer8 2y agoThat’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 2y agoThe limit for syscalls in early Unix seems to be five though. I forget why. Hence, famously, "creat" instead of "create"