“It’s just easier to type” and other lies you believe
itoa
, atoi
Submitted 1 year ago by muleunchangedstarved@programming.dev to programmer_humor@programming.dev
https://programming.dev/pictrs/image/5f48601b-ed79-46ae-a4a2-97b42f561c27.png
“It’s just easier to type” and other lies you believe
itoa
, atoi
Seriously though, why? Is there historic reasons for that? Did they have to pay extra for more letters back in the day?
Yes. Memory and storage were at a very high premium until the 1990s, and when C was first being developed, it wasn’t uncommon for computers to output to printers (that’s why print() and co are named what they are), so every character was at a premium. In the latter case, you were literally paying in ink and paper by the character. These contributed to this convention that we’re still stuck with today in C.
IIRC older DOS versions were also limited to 8.3 filenames, so even filenames had a max limit of 8 characters + 3 extension. May it was a limitation of the file system, can’t quite remember.
Thanks for the insight! I think this kind of convention that once made some sense, is now exclusively harmful, but is still followed meticulously, is often called “tradition” and is one of the high speed engines that let humanity drive towards extinction.
Wait, but they didn’t print out the source code right? Or did they use teletypes to develop?
I worked with a complier that would assume only compare the first 8 characters and would treat it the same afterwards.
Compiler copyright was around 1990.
They did, with core you could be paying for many dollars per bit of memory.
I’ve heard arguments that back in ye old days each row only had 80 characters and variable names were shortened so you didn’t have to scroll the page back and forth
I’ve already felt like I should choose shorter names in a (shitty) project where the customer asked us to use an auto-formatter and a max line-width of 120 characters.
Because ultimately, I choose expressive variable names for readability. But an auto-formatter gladly fucks up your readability, breaking your line at some random ass point, unless your line does not need to be broken up.
And so you start negotiating whether you really need certain information in a variable name for the price of badly broken lines.
We were limited to a certain number of characters for filenames, way back in the Apple ]|[ days. IIRC it was 8
db2@sopuli.xyz 1 year ago
aarch64(32bit)
🤣
bdesk@kbin.social 1 year ago
He was using (a)arch
H2207@lemmy.world 1 year ago
Just the 1 premium linux distro please…
H2207@lemmy.world 1 year ago
x86 backwards compatibility
Cyberflunk@lemmy.world 1 year ago
Commodore 64 effective