r/C_Programming • u/yan_kh • Aug 03 '21
Discussion Why the hell the C programing language doesn’t get the credit and the hype it deserves??
In today’s programmers generation I see so much credit and hype on Rust, Python, Go and JavaScript. But I have never seen C is mentioned. I just started to fucking think that they treat their loved high programming language as a black box, without actually knowing that in the end it’s likely to be based on C, or maybe it’s compiler is written in C, or it’s syntax is inspired from C, or maybe it’s a fucking C derivatives language.
It really makes me upset to see that most of this programmers generation not giving C much of an interest.
Edit: Some of you may have understood me wrong. I’m not complaining about the other high level languages. Every language has it’s purpose and a reason why it was developed and created. On the other hand, what I’m trying to say is that C isn’t getting much credit nor interests from the new generation of programmers, whereas C runs the world in one way or another.
31
u/pedersenk Aug 03 '21
C isn't governed or sponsored by a commercial entity paying for publicity.
However it does pretty well on (admittedly superficial) leader boards such as TIOBE index (It is often #1). Is that not hype enough?
C *is* the computing platform. No matter how much cooler other products are, they are still dependent on C.
7
Aug 03 '21
What is interesting is that C has been in the top 3 for many of the last 20 years of the TIOBE. Yes, it is a difficult language to grasp (at first). Yes, is a powerful language to master and programming to the standard will make you a strong programmer. Yes, it deserves more credit. But, I think, like DND, it thrives because of the community it brings together.
3
Aug 03 '21 edited Aug 03 '21
I'd dispute that. C is just dominant now because it was used to build Unix, and that OS has itself become dominant.
But there is nothing special about the language; anyone could make an equivalent systems language in the 70s and 80s, and some of us did. (I'm still using mine.)
The mystery is why there was such limited competition, and why it mostly died out. The alternates now are monstrous affairs that I for one would not label systems languages.
Which brings us to your statement on dependency. Well, the dependency is mostly on APIs that use C-style data types.
(It's rather galling to call them C-style, as there is nothing special about what are really machine types, and arrays and aggregates of those types, yet the way C presents those simple types is appalling. Here's a challenge: what is the equivalent of C's 'char' type in any other language? Hint: it's neither a signed nor unsigned 8-bit byte.)
What's on the other side of the APIs are libraries that could have been written in C, or any of a number of languages including ASM, but in binary form are just machine code. You could take an existing library, and rewrite it in a different language but with the same interface. It will work the same way, but where's the C?
These APIs are often exposed through declarations written as C header files, which are actually a nightmare for those trying to use alternative languages. For popular libraries (and popular languages, ie. not mine!), some people do the hard work of creating suitable bindings.
Personally I would rather not deal with C. C-style headers written as a strict subset of C (with well-defined universal types and with NO macros and other things that are problematic outside that language), are good enough for expressing interfaces universally, in the absence of a custom made language.
Then it would be easier for automatic tools to generate bindings for alternatives.
One characteristic of C APIs that it deserves some credit for (by being so ubiquitous), is that it lacks higher level types. The simple ones that are left are easier to interface from via FFIs. (Try using a C++ library via C++ headers from your FFI, which are going to be 90% C++ specific features.)
2
u/pedersenk Aug 03 '21
I don't disagree with what you are saying (though I personally am quite fond of the language, it has served me well). However unless a popular operating system written in a different language takes hold, C will still remain dominant. Other languages will need bindings against C which adds additional dependencies and complications.
I think Rust and Redox OS is the closest non-c OS we have?
2
Aug 03 '21 edited Sep 05 '21
this user ran a script to overwrite their comments, see https://github.com/x89/Shreddit
2
u/pedersenk Aug 03 '21
macOS due to the BSD subsystem, Mach kernel and Darwin underpinnings is still heavily C.
However some of the upper layers are Objective-C (and some of the very recent stuff is Swift) so I suppose that does affect what constitutes the "system language" for the downstream developers. However you still commonly call into libc. This I feel we would need to get away from if a platform were to break ties with C completely.
As for C-based/derived/compatible/subset languages. Yes I do still count them as C. Mainly because it is leveraging C rather than replacing it. Arguably I believe Rust will be a much stronger contender to C++ if it did include a tiny C compiler just to allow it to consume C headers (like C++ mostly can). I also predict that Objective-C will re-succeed Swift due to this close to C nature (though perhaps don't stake your career on my prediction! ;))
Same is true with ReactOS and SerenityOS rather with C++ instead of Objective-C.
1
Aug 03 '21 edited Sep 05 '21
this user ran a script to overwrite their comments, see https://github.com/x89/Shreddit
20
17
u/LoquaciousRaven Aug 03 '21
C is hard and Python is easy. Therefore, Python >> C!
/s
17
6
5
u/726372816482 Aug 03 '21
I think the biggest issue with C is how easy it is to fall into an undefined behavior trap. The app can run for a long time, until one day it doesn’t and can take hours upon hours of time to find root cause of a crash. Of course same can be said for C++.
2
4
u/poincares_cook Aug 03 '21
Go to the python sub, read the posts.
Everyone is well aware that python is built on libraries written in C. Look for references for Cpython. Look for explanation of "weird" behavior like the stack depth.
Sure the novices and newbies are not aware how much of the language is built on C, but you can't be an intermediate without understanding at least to some extent the tie between the two.
4
Aug 04 '21
You already mentioned it's a hype. Hype usually goes to anything that is new which is why Rust and Go are "hyped". For Python it's mostly because of the data analysis/mining/science hype. For Javascript, well it's pretty much the standard of web frontend programming and web has been bigger and bigger since its birth many decades ago.
C is in a different picture. It's a system programming language so most your application programmers don't use it. It's really difficult to get "hyped" for something you don't use, right? But C is good and will be still there when some of those "hyped" languages come and go. So far I don't see anything that can replace good old C in the near future.
8
u/sambomambowambo Aug 03 '21
There is a reason languages like python and JavaScript exist. Because they are far more readable than C.
Why would you write in a convoluted language unless it’s absolutely necessary?
3
3
u/ur4nium_235 Aug 03 '21
bc companies will pay big money for someone who can do machine learning in one line with python /s
3
Aug 04 '21
A strawman. As it does. I think your assertion is simply false. But obviously little recognition from those that don't want nor need it for their apps. It powers most hw, the Linux kernel and so linked to most mobile phones. It's held in very high esteem.
4
u/gremolata Aug 03 '21
Shhhh... don't, don't attract any attention.
Just look what all the love and hype did to the "C with Objects."
3
8
u/IenFleiming Aug 03 '21
Because pure C is a horriffic language to write in. It makes the programmer write and think a lot more, it requires a LOT of knowledge and doesn't offer almost any facilities compared to other languages. Pure C feels like a god damn UAZ. Yes, it drives, yes, it's one of the best if you want to go off-road, but at the same time it's extremely uncomfortable, loud and uneconomic, and you definitely don't want to drive one every day.
8
u/Dolphiniac Aug 03 '21
Speak for yourself. Every time I dip into another language, it just reminds me why I love programming in C so much.
2
u/IenFleiming Aug 03 '21
You surely will also find people who daily their UAZs, and are profoundly convinced that their cars are the best in the world. Would you like to explain why do you find C so much better?
9
Aug 03 '21
C does what you tell it to do.
6
-6
Aug 03 '21 edited Sep 05 '21
this user ran a script to overwrite their comments, see https://github.com/x89/Shreddit
3
u/R3spectedScholar Aug 03 '21
I don't get what does this comment mean. INT_MAX+1 overflows to INT_MIN and that's smaller than 0. Printf returns 1. Am I missing something very obvious?
5
1
Aug 03 '21 edited Sep 05 '21
this user ran a script to overwrite their comments, see https://github.com/x89/Shreddit
0
u/not_some_username Aug 03 '21
Are you a morron ?
0
Aug 03 '21 edited Sep 05 '21
this user ran a script to overwrite their comments, see https://github.com/x89/Shreddit
0
7
u/Dolphiniac Aug 03 '21 edited Aug 03 '21
Who said better? I said I prefer programming in it to other languages, which was the counter to your assertion that one does not want to do so.
Edit: Though in the interest of not being obtuse, I will still answer your question, if reworded to "what causes you to prefer C?"
I work in game development, specifically custom engine code. As such, my performance needs are great. C# does not work for me, and neither does Java, because they are garbage collected. I'm not fine with my memory being cleaned up for me at an unspecified future point, taking "as long as it takes lol". Scripting languages are easy to use because they do fancy stuff to hide what's going on or employ weak typing to require fewer strokes and make refactoring slightly easier. Functional languages are very similar in that regard (if I hear lazy execution one more time...). C++ is the de-facto standard language for it, and I think it's fine, because it hits some of the notes I care about: manual (to an extent) manipulation of memory, allowing me to employ custom allocation schemes with ease and promote cache-friendly behavior; strong typing (to an extent), forcing me to stay kosher and not allowing me to make stupid mistakes like mixing types or storing the "wrong" literal into a variable (because I care what is actually happening); procedural execution, keeping the focus on what work items are being executed (after all, the processor works this way too).
Where C beats C++ to me is where it simplifies. No ctors and dtors means no hidden execution. If something's gonna expand to be a complicated subroutine, it's going to be a function or a macro, both of which are easily recognizable with a syntax highlighter. No SIOF. Without classes, there are no methods. Without methods, it is simpler to see where data is coming from (no automatic
thisresolution means any variable must be a global or local variable). Without classes, you are also not encouraged to put your private data in a public header, where it is dead simple for a user to just changeprivatetopublicand touch data they're not supposed to touch in a way that can seem predictable. No templates means it's more difficult to do generic containers, though they can still be done in a less type-safe way, but without them, I am still more able to know what's actually happening, as what would otherwise be variable based on an instantiation at declaration time (and which I still have to parse logically without a readable template instantiation, as the code only exists on paper in the generic version) is instead manipulated with data, which I can debug. And my compilation time doesn't explode because I put all my implementation details in the header so it can be templatized.And yes, most of these things can just be avoided when using C++, but I find the temptation too strong. I'd rather be constrained into making what I feel are the right choices.
0
u/dontyougetsoupedyet Aug 03 '21
C is a horriffic language
makes the programmer write and think
lol. I'm basically always going to have employment. I love it.
3
2
Aug 03 '21 edited Sep 05 '21
this user ran a script to overwrite their comments, see https://github.com/x89/Shreddit
3
Aug 03 '21
I avoided C and its libraries for nearly 20 years. I eventually had to use it because APIs for the new Windows 95 OS I wanted to use, used C, or at least had headers defined in C syntax.
But I still didn't write in C; I had to replicate the API functions I needed in my alternate language, which then accessed the functions via system DLLs.
Later, newer WinAPI libraries used C++ (I don't use those), but MS also relabeled the older C APIs as C++, which they are not (or rather, they will work for either I guess).
Pascal (Ada)
Pascal itself came after Algol60, and I think was also a reaction by its creator to Algol68, which was seen as a too complex successor to Algol60. My own languages were inspired by Algol68, but were simpler and lower level. (I can't abide the begin...end blocks of Pascal, which are as annoying as {...} blocks in C.)
the de facto ABI ... of every platform.
ABIs are supposed to be language-neutral, or people will claim that. In reality you will see influences from C, especially on Win64 ABI I'm most familiar with. All the usual C alignment and padding rules for structs and such.
(Or perhaps you meant API? Then I can't disagree! I just wish C used more concrete types than the wishy-washy 'char' (which might be 8 bits and might be signed), or long which depends on platform. Not enough APIs use int8_t and so on.)
1
Aug 03 '21 edited Sep 05 '21
this user ran a script to overwrite their comments, see https://github.com/x89/Shreddit
0
Aug 03 '21
C is an awful, outdated and obsolete language.
unfortunately, it is also still the best programming language.
we've come so far, and yet, we haven't. everyone tries to "improve" C by adding big idea concepts to it. and those big idea concepts are often only good ideas for that year.
some Frankenstein monstrosities ( i'm looking at you, c++ ) tack on every idea that comes along, good or bad, in whatever shape or form that can be shoveled into the language.
0
Aug 03 '21
[deleted]
7
u/p0k3t0 Aug 03 '21 edited Aug 03 '21
With a dorky hipster name.
Edit: Christ, it's even worse than I thought:
https://en.wikipedia.org/wiki/Comparison_of_JavaScript-based_web_frameworks
5
18
u/jzia93 Aug 03 '21
Why do you think C doesn't get credit and hype?
It's widely seen as the grandfather of modern programming, the original creators are widely lauded as some of the most influential contributors in the history of computer science.
Most popular languages pay homage to C by using curly braces and semicolons, to the extent that they are often referred to collectively as "C style languages" when describing the syntax.
Finally, everyone shits on C++ for being impenetrable and designed by committee, while people regularly regard C as a beautiful, concise language, that needs careful attention to use well.
I think C does just fine.
Also everyone seems to shit on Javascript and Python.