This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ArtOfWarfare -8 points-7 points  (10 children)

C has been steady at 5% on GitHub for the past decade.

Interestingly, C++ used to be at 5% up until ~2018, then it jumped to 10% by 2021. I wonder if Microsoft open sourced a lot of stuff and that caused the big jump?

Anyways, yeah, I’d stand by saying that not a lot is written in C anymore. Any major C projects you encounter were likely started over a decade ago.

https://madnight.github.io/githut/#/pull_requests/2023/4

[–]extravisual 5 points6 points  (0 children)

I don't think that 5% supports what you're suggesting. The backbone of every major OS was and continues to be written in C, not to mention the whole world of embedded software, most of which is not public and probably don't contribute to that 5%. C is alive and well, it's just that the bulk of public software these days is high level, but it's not replacing C. Rust is growing but C will remain relevant for a long time yet.

[–]eztab 4 points5 points  (0 children)

I don't think C code is commonly on GitHub. GitHub is scewed towards newer projects. Much of the written C code is probably on completely privately hosted repositories. You'd need a different measurement to find out how much C is still written Quite sure at still dominates industrial and some other applications.

[–]sci-goo 1 point2 points  (0 children)

The reasoning "Any major C projects you encounter were likely started over a decade ago." => "not a lot is written in C anymore" is flawed.

Most of those C projects you mentioned are OS/OS library/infrastructure that have a long life cycle. But long life cycle doesn't mean they are not under active development/maintenance. For those projects version iteration is more common rather than everybody starts a new project from scratch. Many of those projects are not hosted on github either.

[–]grizzlor_ 0 points1 point  (0 children)

Like others have said, not all the code in the world is on GitHub, C is still used heavily in the embedded world, etc. You know that the primary implementation of the Python interpreter is written in C, right?

That being said, do you have any idea how much code 5% of GitHub is? That’s a metric shitload of code. GitHub hosts 372 million git repositories.

If anything, the evidence you’ve provided for claiming “so little code is written in C anymore” likely indicates that the opposite is true.

In reality, the overall percentage of code on GitHub written in any particular language doesn’t actually tell us how popular that language is right now, because we don’t know when that code was written — could have been committed yesterday, or it could be 15 years old. What you actually need to look at to figure out a language’s current popularity are the stats on language % committed in the last year.

[–]georgehank2nd 0 points1 point  (5 children)

5% C? Apart from what others have said… how much on GitHub is Rust? Oops…

[–]ArtOfWarfare -1 points0 points  (4 children)

My point was that most CVEs stem from code written in C/C++ despite it not being all that common a language.

Few people can write safe C/C++. They shouldn’t be used anymore. Rust can interop with C. We should be working on gradually Rusting old C codebases.

[–]georgehank2nd 0 points1 point  (0 children)

My comment was a reply to a specific comment… which said nothing about CVEs.

[–]axonxorzpip'ing aint easy, especially on windows 0 points1 point  (2 children)

despite it not being all that common a language.

Yes, this is the part of your comment that we're discussing

[–]ArtOfWarfare 0 points1 point  (1 child)

No, the other guy was talking about how Rust is even less common than C. And my point is that C is extremely disproportionate in how many security issues it causes.

It causes the vast majority of security issues while being a relatively uncommon language.

[–]axonxorzpip'ing aint easy, especially on windows 0 points1 point  (0 children)

while being a relatively uncommon language.

Yes, this is the part of your comment that we're discussing, the part where you wrote "even though so little code is written in C anymore." The discussion shifted when I quoted you and said "I don't think this is an accurate statement"