this post was submitted on 26 Aug 2024
1198 points (99.0% liked)

Programmer Humor

19176 readers
960 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 120 points 3 weeks ago* (last edited 3 weeks ago) (58 children)

Why are they even named like this?

When I read code, I want to be able to read it.....

Is this from a time when space was expensive and you wanted to reduce the space of the source files on the devs PC???

For me (with a native language != english), this made it a lot harder to get into programming in the first place.

[–] [email protected] 2 points 3 weeks ago* (last edited 3 weeks ago) (9 children)

strncpy becomes stringnumbercopy. You can see why short version is used.

[–] [email protected] 14 points 3 weeks ago* (last edited 3 weeks ago) (7 children)

And with a bit of namespacing and/or object orientation and usage of dots, it becomes perfectly readable.

There are also camel case and underscores in other languages...

BTW: How on earth should a newcomer know that the letter "n" in that word stands for number without having to google it? The newcomer could even assume that it's a letter of the word string..... And even, if you know that it stands for number, it's still hard for me to understand what it means in this context... I actually had to google it... But that's probably some C++ convention I don't know about, because I don't program in C++.....

[–] [email protected] 5 points 3 weeks ago

C is a little older than namespacing and object orientation. C++ wasn't even a glimmer in Bjarne's eye when these conventions were laid down.

And yes, having to google it is part of the design. Originally C programmers would have had to read actual manuals about this stuff. Once you learn the names you don't really forget so it works well enough even now for ubiquitous standard library functions.

And yet, C was an ergonomic revelation to programmers of the time. Now it's the arcane grandpa that most youngsters don't put up with.

load more comments (6 replies)
load more comments (7 replies)
load more comments (55 replies)