It is C’s fault. If you are in the C mindset, you use this. Using C to write a program is basically an accumulation of bad practices and bad programming.
It’s not explicitly forbidden to use proper naming. It is not explicitly encouraged to use improper naming.
However, every C veteran and all who like C do this all the time. I do not believe this is an accident or just coincidence. It’s how humans work. Attitudes spread. People view things differently. A Frenchman views the world differently, compared to an Englishman. Same goes for sailors and professors at a university. The same world is perceived in different ways.
Now, in C, the mindset makes users think that using a variable name consisting of a single letter or two is enough.
No, it’s not enough. It’s bad practice. It’s unreadable. It does not even say what it is supposed to be.
Examples to prove my point:
https://linux.die.net/man/3/getgrent ← Should be getGroupEntry
https://linux.die.net/man/3/putgrent ← Should be addGroupEntry
(What the hell is a grent
??? The Grinch’s brother?!)
https://linux.die.net/man/3/getpwnam ← Should be getPasswdEntryByName
https://linux.die.net/man/3/getpwent ← Should be getPasswdEntry
https://linux.die.net/man/3/putpwent ← Should be addGroupEntry
And many more…
This is an example of how it should look:
int main()
{
int myCarInsuranceRate = 1;
}
There are plenty of examples of alternatives having written OS kernels. Two examples, which come to my mind immediately are kernels written in Nim and Rust.
Nim uses C under the hood, so it’s technically just as compatible as C. But without all the cancer of C for people who program using this language.