If linux distros were programming languages

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.

COBOL - idk red hat?

OK, that is out of my experience. But I can guess memory management is the big issue that makes Nim better than C.

By the way, there is one large project on the web which is largely Fortran based. It is called R. Yes , most of the math libraries behind R are Fortran, some are C. I want to do some in Julia, if I ever get there.
R needs better parallel processing.

Neville

I am disappointed how this joke post consisting of correlating distros to programming languages became a tense debate about C. C is a good language, all are. They were designed for a specific purpose. No matter how hard you hate C, C++, Java, Python, JavaScript(i hate it too), they are evergreen giants that you can’t get rid of no matter how hard you try(go, rust, julia, nim). C was designed for low level stuff. How will we talk to hardware only in high-level languages?

1 Like

You obviously read about 0.5% of everything I have said. I already answered all these questions and I hoped to have given enough examples to make myself as clear as possible.

C is good, if nobody has to use it. For example, if using Nim, nobody has to use C. It’s under the hood. You don’t have to be forced to deal with the negatives of C. The compiler does it for you.

My question to you:

Why don’t you program all systems projects in Assembly? It’s (well, almost) as low level as it gets. :wink:

Then technically we should learn Haxe and give up every programming language since Haxe compiles to Python, Java, JS, C, C++. We can do everything only with Haxe. C will never die honestly. It started in the 70s and has lasted till 2022 up to now. You remind me of Ilya Suzdalnitski and Richard Kenneth Eng, who want to erase so many mainstream languages just because of one little sh** that exists in their favorite language(functional paradigm, message passing)

[getgrent(3): group file entry - Linux man page](https://linux.die.net/man/3/getgrent) ←
 Should be `getGroupEntry`

I dont like that camlcase style at all.
That is something you have inherited from stuff like java
what is wrong with getgroupentry

Well have heard of OCaml? It can replace C… MirageOS is written in OCaml only with a low level layer written in C.

Yes, I have.

That’s a valid statement. It’s not so much about camelCase. It’s about using words, humans understand, not only machines.
Therefore, getgroupentry is fine, as long as the words in it are clear to humans. get, group and entry are normal words of the English language. However grent is unknown. And it takes reading the manual that it means Group Entity

I’ve heard of that language, but I never looked that much into it. Thanks for the information. I will look into it and give feedback, if I discover anything. :+1:

It all depends on the definition of how a language may die. Is Latin dead? It’s not spoken, but taught all over the world.
For example, I have nothing against teaching C at a computer science course. It’s a good language to learn about the internals of a computer and how a compiler works. It’s great for educational purposes. But keep this knife without a handle out of production code.

It’s not about Nim. I just mentioned it, because people always ask for alternatives. So, I give them the alternative. That’s it.

My hate toward C is entirely based on how C works. It is not directly related to Nim. Nim is just the answer to what do I use instead of C, then?.

Additionally, I do not hate C, because of one problem. Or two. No language is perfect. Not even my favourite languages (obviously). I even know things in Nim, that aren’t that great.

It’s about the vast amount of mistakes in C and that this language is used in production code right now, all around the globe.

Basically, C is just a mistake language, but still hugely popular. That’s my issue with it. Keep human maintained C out of production code and my hate will stop, immediately.

There is a reason for this sort of stuff. It is called generalisation

If I write a program that has
int carvelocity;
then it is most likely going to be a very specific program that is only useful for a single problem.

However if I write an
int a;
style of program, it might , if I am clever enough, be usable for a whole range of applications.

The more mathematical an application program is, the more likely it is to be a general purpose routine useable over and over.

Generalised routines are more difficult to write, but are many times more useful. There is really no point in using application specific names in a generalised routine. You just use math symbols. And explain how to use it in the documentation.

If you are suggesting that modern languages encourage meaningful names, then they probably do not encourage the most creative part of programming which is generalised routines. You cant have it both ways.

I am not just talking about scientific programs. An enormous part of systems and business work is wasted on one-off jobs to meet stupid deadlines. Modern software encourages this wastage by making easier to write code for every little need, and therefore harder to justify the effort needed to make general packages.

There is hope. Julia makes it hard to do anything, and doesnt seem to encourage any particular name convention.

Neville

@nevj
I have to admire the one’s whom really understand programming and or computer language. If I were
younger and had the time, then maybe I could, but at my age and point in life, I consider myself
lucky to even remember how to install Windows or Linux.

1 Like

I love camel case… you’d hate to see my digital music collection - soon as I’ve ripped that CD, or downloaded that FLAC album from bandcamp, I’m replacing all the SPACES in the filenames (WHY? spaces in filenames is an abomination) with camel case, same with my DRM free ebook collection…

1 Like

Noone understands everything in computing. It is too large a topic.
You know a lot more than the average user
Keep doing things
You dont lose it. I had a period of about 10 years when i completely ignored computing ans went farming. It comes back as soon as you do things.FOSs has helped stir up some of my memories.
Neville

Its OK I dont care if others use it.
Just not a good enough typist
and
I was taught that .statements need to fit in 80 columns… and it stuck
Neville

Very informative post. Thanks for messages.

1 Like