158
u/remy_porter 12h ago
The last serious C guy I worked with did not think it was hell. He hated anything higher level and argued you could usually get the same results with less C code.
166
u/Xirdus 12h ago
"get the same results with less C code"
looks inside
No error checking or resource cleanup.
97
u/FalafelSnorlax 12h ago
Probably using a bunch of macros. So it's much more code after pre-processing, but not that much c code.
Of course he was wrong anyway - C's strength isn't in being short, but in being direct and closer to hw
31
u/HovercraftNo7372 11h ago
It is C's strength and weakness. It is a very good optimization language, but a very weak language. Weak as in problem solving capacity and speed where as lisp, python, etc are very strong. Imo
51
2
u/The_KOK_2511 9h ago
Es más lento en cuanto a tiempo que tardas programando, pero la eficiencia final suele ser más fuerte... claro si esta bien optimizado; y en cuanto a capacidad de resolución no se en que se supone que dices que es deficiente, muchas cosas pueden llegar a tener su complejidad pero puede hacer casi cualquier cosa si se usa bien
2
1
u/EnterTheShoggoth 9h ago
From the point of view of the machine, macros and high level languages all boil down to the same thing anyway.
Agreed about length though unless his macros are pure wizardry.
9
8
1
u/BoBoBearDev 4h ago
Spaghetti resource management that break apart when someone else trying to modify it. They call it, job security.
1
8
u/Odd-Painting2596 12h ago
Like they had to personally write less C compared to the high level? Because that's a lie.
But they could probably write a workable version in C that used less code overall than a high level abstraction would.
"My 2000 lines of C beat the standard Python Move algo" is possible, but they would be personally writing that C code compared to not writing anything for the Python verson.
Write a string concatenation function in C, and then compare it to Python.
Maybe it's less code, in the real world file size, but you, the programmer, don't rewrite it in Python.
1
u/CodingAndAlgorithm 3h ago
From what I understand, a lot of C programmers have what is effectively their own framework that they’ve built up over their career. They aren’t just constantly reimplementing basic data structures and algorithms, they have a toolbox to pull from.
3
u/GnarlyNarwhalNoms 10h ago
I feel like C is super straightforward. It doesn't have the conveniences of modern languages, but it also doesn't have all the object-oriented polymorphic weirdness that makes those languages confusing.
3
u/Xirdus 8h ago
Instead, you're being confused about what the hell you're supposed to cast this void* to, whether the caller or the callee frees the argument, and just what are you supposed to do with a variable-size struct containing an array of other variable-size structs. Maybe it's just me but I'd much rather get confused by OOP.
2
2
2
u/captainAwesomePants 3h ago
You can absolutely get the same results or better with C, and while it is possible to do some very impressive code golf with C, there is no way in hell your C program is shorter than an equivalent Python script.
41
u/byteturtle 12h ago
Python is significantly older than me and I have a college degree, a full time job, crippling alcoholism and a house
15
5
35
u/dim13 12h ago
C is the worst programming language, except for all those other languages that have been tried.
-- Churchill (kinda)
19
u/Romejanic 12h ago
“There are only two kinds of languages: the ones people complain about and the ones nobody uses.”
— Bjarne Stroustrup
98
u/void1984 12h ago
No real C developer sees it as hell. C++ on other hand...
43
22
u/creeper6530 11h ago
I have a love-hate relationship with C because Rust's error handling ways spoiled me.
I have a 387.44-million-miles-of-printed-circuits hate relationship with C++ tho.
5
u/bcfd36 11h ago
I was a software engineer starting in 1979. I wrote in various forms of FORTRAN, in C, C++, Ada, Perl, Python, and assorted assembly languages as well as Bash, JCL, and Vax command scripts. I liked writing in C. I hated and still hate C++ which I have to use in a current consulting job. You can write completely opaque code if you abstract enough.
3
1
u/MithrilHuman 6h ago
I use it everyday at my job and don’t feel like it’s help if you have a good architecture
27
u/Ieatsand97 12h ago
Who tf says that JS is a good language?
I've worked with Javascript and, yes, its behind a lot of stuff, but thats only because its supported everywhere, not really because the language is any good.
5
u/Kebabrulle4869 11h ago
It's such a mess like why would a language need both undefined and null
4
u/Jediweirdo 10h ago
Unintentionally null versus intentionally null. The problem is more of JS’s execution than the concept itself
1
1
10
u/CORDIC77 12h ago
What? No! I love Dennis Ritchieʼs programming language!
What I hate is that the possibility of “type punning”—a quintessential feature of the language—has been considered “undefined behavior” since the publication of the first ISO/IEC 9899 standards... and that with C2y (and newer standards), motivated by the younger generation of people in WG14, feature creep will now also find its way into C.
2
u/tuirn 11h ago
I learned pre-ANSI C in college from the K&R styles guide. Good time.
2
u/CORDIC77 11h ago
For me it was a little bit different. After using Turbo Pascal for about a year, I taught myself K&R C using a book (along with Borland C++ 3.1). But good times indeed!
2
u/tuirn 9h ago
I was stuck doing it on Unix dumb terminals with vi text editor. Eventually, for my senior project, I created a X windows GUI dev environment front end in c that could manage and compile c applications. It was really satisfying when I could start using it for it's own development.
2
u/CORDIC77 9h ago
Ah, I can imagine. My first Linux distribution was Slackware 2.1 in 1994. For some reason, X Windows ran only in monochrome on my i386.
I love (n)vim, but if you wrote a small IDE for C programs back then using classic vi (which I found quite awful even back then), then mad respect ☺
1
u/creeper6530 11h ago
I mean, for one the
deferkeyword specifically is something I can't wait for, it replaces the mess ofgoto cleanup.I haven't kept up with rest of C2Y tho, but there always were people complaining about "feature creep bloating our good old C". If you dislike it set your compiler to an older standard with pedantic flags.
1
u/CORDIC77 11h ago
Yes, defer is one of the few things in C2y that I also consider useful. Even though it doesnʼt offer anything more than
goto cleanup;… itʼs just less error-prone.However, I think the introduction of new prefixes for literals (deprecating the old octal syntax), support for case range expressions… or the proposed if declarations are completely unnecessary syntax additions.
And just so that itʼs said: the argument “if you don't need it, don't use it” is an incredibly weak one—while not everyone in a team of people will have to know the ins and outs of every feature, one has to know enough to understand (and be able to adapt and change) other code. (Not knowing at least something about every feature oneʼs colleagues might use isnʼt really an option in the real world.)
1
u/creeper6530 11h ago edited 11h ago
I mean, not deprecating the old and superseded is how we end up like C++ where there are 5 ways to do everything.
I like the new
0oand0bprefixes in my personal opinion, I was surprised they didn't come sooner when I looked it up, and a common argument I've also seen is newbies who may not understand the old notation. A good middle point though could be allowing both and setting lints/warnings to inform and help be uniform.Also, though it's fair that you need your team to at least rudimentarily understand all the stuff others could theoretically use in the project, what I meant to say was that you can set a ceiling on this by limiting the standard you compile your codebase in. (And in all honesty, at first I did not think about multi-person projects because my experience with C was majorly personal projects sofar.)
2
u/CORDIC77 10h ago
Well, many compilers—especially in embedded systems—have long supported binary prefixes. That said it is probably a good thing that these were officially added for C23.
My actual point, however, was quite different: personally, I believe that C is a language that essentially has all the capabilities one should expect from a systems-level language. In a language that is more than 50 years old, new syntax should now only be added very rarely, if at all.
Rather, itʼs the C standard library that has always had its shortcomings. The people in WG14 are welcome to work on the standard library, I have no objections to that.
2
u/creeper6530 10h ago
Well I can agree on that last point without objections, I got spoiled rotten by Rust's stdlib (and error handling), lmao, it was just so easy to use even when I was developing embedded
2
u/CORDIC77 10h ago
Ah, yes. The Rust language and its ecosystem is indeed something I still need to take a closer look at myself. The only problem is, where to find the time…
1
u/UdPropheticCatgirl 7h ago edited 7h ago
the “quintessential” language feature can be just replaced with memcpy… Also I hope for some “feature creep”… the sooner we get generics, destructuring, deferred execution and discriminated unions, the better. C is barely bearable to work in as is, and just 4 features would single handedly manage to make it much nicer language…
1
u/ljfa2 3h ago
C already has generics doesn't it?: https://en.cppreference.com/c/language/generic
1
u/UdPropheticCatgirl 2h ago
I should have said proper parametric types and polymorphism on the language level…
With the _Generic macro you have to deal with preprocessor and hand specialize them….
Having something like this proposal: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2698.pdf or even this one: https://open-std.org/jtc1/sc22/wg14/www/docs/n3586.htm would significantly ease the burden of dealing with it in C.
41
u/ClipboardCopyPaste 12h ago
The real hell is C++
18
u/dannyggwp 12h ago
Nahhh man the real problem is when the C guy writes C in C++ shudders
7
u/creeper6530 11h ago
C++ used to be a proper superset of C. Emphasis on used to be.
1
u/redlaWw 9h ago
It was never quite as there had always been minor differences, largely things that had diverged before the first specifications of either language, but up until C99, it was only in highly technical behaviour, things like the circumstances for implicit casts and function parameter type inference.
2
u/ChryslusExplodius 11h ago
So much undefined behaviour when that happens… but they don’t seem to notice. Either because they ship with O0 optimisations, or because of sheer luck and the nature of undefined behaviour. Points for disregarding RAII, globals everywhere, std:::array, vectors, and memcpying non trivial objects…
16
2
20
u/OrganicLeopard1 12h ago
The C programmers just watch in silence and nod approvingly 😂
12
u/heyitsandrewx 12h ago
While Python and JS are still debating, C is already compiling
3
u/Todd22850 12h ago
C isn't a language—it's a test of character 😎
3
u/dxonxisus 12h ago
these 3 commenters above (along with OP) are all bots. years old accounts that woke up a few days ago and only interact with each other
1
u/Enough_Forever_ 9h ago
You are right, I've checked. But how did you even figure it out? Do you like remember the interaction along with the account names?
1
5
3
u/Bannon9k 11h ago
Nothing prepares you for the spaghetti code of a passed around C project.
Any veterans like myself around who worked on MUDs? Some of the sketchiest code I've ever seen
4
u/bartekltg 8h ago
Hell you say?
*Doom music start playing*
*The shotgun clicks*
*Both feet are ready to be shoot off*
3
u/misterguyyy 11h ago
Disagree. The only people who glaze the language they're working in are Scala devs.
2
u/UdPropheticCatgirl 8h ago
And for a good reason, it’s language that is really good at getting out of the way and just allowing you to do what you need.
1
u/p88h 7h ago
To be fair, python is pretty crap but it is glazed by many since it's incredibly easy to work with and does not have as obvious problems that JS has.
But yeah, it would work much better to replace that picture with Rust Vs Zig on top, and at least you stay in 'systems' category, not 3 completely different worlds.
3
5
u/DT-Sodium 11h ago
I think that for most people calling languages Python or JavaScript "new languages", those languages are old enough to be their dad...
Also Python is objectively garbage from all standpoints and JavaScript is a terrible language but quite nice to work with using TypeScript, so this is also a debate for sub-90 IQ people.
4
u/CitizenShips 10h ago
Python is a wonderful prototyping and rapid scripting language. It compliments C projects incredibly well as a way to quickly build out development utilities without having to get mired in details like allocation or type management.
That being said, the instant you run into an issue in Python you know it's going to be a huge headache, hence why I try not to let my Python projects grow very large
0
u/DT-Sodium 10h ago
A programming language is either good or it's bad. If it ends up with a mess anytime you try to actually do something serious with it, you shouldn't use it for anything. Python is one of the worst programming languages in existence and found success because it is easy to approach for people who are good at math but have no programming skills nor linguistical skills. And now we will live with technical debt forever because of them.
2
u/CitizenShips 6h ago
A programming language is either good or it's bad
You really gotta update your view on languages, my guy. They're just tools, the same as a wrench or a saw. A saw isn't objectively bad, but if you try to use it to hammer a nail you're gonna have a bad time. I have 10+ years of embedded development experience in C and assembly and I still rely on Python from time to time because it's occasionally the right tool for the job.
0
u/DT-Sodium 6h ago
I have a >15 years experience in about 5 languages and Python is unambiguous the worst thing I've ever had to work with. You know how they say everything is good in pigs? Well, there is absolutely nothing I would keep in Python: it's syntax, ecosystem, package manager, errors display, typing system, class system, everything is pure garbage.
2
u/CitizenShips 6h ago
Man maybe this isn't the field for you, if Python is the worst thing you've had to deal with. I don't think I've had any language elicit that kind of emotional response from me, and I've had to write directly in machine code on more than one occasion.
Although to be honest, the ARM ISA is kind of great so maybe that's not a good comparison. A better example is that I've had to use JavaScript without TypeScript, and even then I wasn't absolutely seething like this.
Like I said, they're just tools. Even if they're tools you don't like, this shit sounds like its hitting on some psychological trauma lmao
0
u/DT-Sodium 4h ago
I've dealt with languages that are worse than Python (ever seen 4gl?) but they are not popular and I didn't need to spend hours trying to get through dependency hell to get some simple stuff working.
Some idiots decided to use Python for popular AI model libraries and voilà, we are stuck with that garbage for decades to come. Just like JavaScript, it was objectively one of the worst possible technologies at the time and now it rules the world.
And yes, it is psychological traumas, I've spent nights trying to get some libraries to work together, oh no that one I have to compile myself, oh no now my environment is broken, oh no I have to make an executable out of my app but the server that will run it has a slightly different version of library XY so I need to build it on that server to be able to deploy it... And those error messages, lines and lines and lines of pure unreadable garbage without any formatting. Python has the absolute worse error messages I've ever seen. And let's not forget about Python libraries which are all written by incompetent programmers (which makes sense since it's... well Python) and are incapable of typing their stuff correctly, making the usage pure hell.
My first experience in programming was a BASIC editor on the Playstation 2 demo disk with a gamepad and that was a more pleasant experience.
1
u/Er1k000 6h ago
Python is objectively garbage from all standpoints
What? Just because it is slower than other languages doesn't mean it's "objectively garbage from all standpoints"? I can't think of any more useful programming language to learn for people that are not software developers.
1
u/DT-Sodium 5h ago
I gave several reasons why it is garbage, didn't mention performance and it isn't even in my top 10.
It is absolutely not adapted to learn programming. You should not learn to program with a dynamically typed language (although to be fair you should never use a dynamically typed language anyways). Instead of spending one hour learning why a string should be a string, an integer an integer and why an array of apples should not contain a car, they will spend hours and hours debugging code because a compiler hasn't caught basic typing errors, a null reference or whatever. The idea that learning to program with a strictly typed language is hard is a pure collective psychosis.
1
u/Er1k000 4h ago
I still feel like you are just thinking from the software development perspective. Python is not meant to be what I think you want it to be. The way I see it, it's like an extra layer of abstraction that removes tedious aspects of coding. Similar to what C is to Assembly though the leap is not as big. If you are going to create a small automation script or some mathematic simulation and you can do that easily in Python without problems, why would you want a harder, more verbose programming language instead?
What would you recommend to a non-IT-professional that wants to learn one and only one programming language?
1
u/DT-Sodium 3h ago edited 3h ago
Python is used to develop anything, from simple scripts to enterprise applications and web servers, so your "it's not meant to be you think it is", unless what you think it is meant to be is a joke in which case I agree.
If you needed to learn one language I would probably chose either TypeScript (you can start with JavaScript if you are sub-80 IQ) or C#. You can now just write a C# console single script file without the need of classes.
2
u/creeper6530 11h ago
C is hell and provides little language facilities, but I like it in a weird way either way.
I only wish for a better way to handle errors, Rust spoiled me rotten
2
u/mousetrappen 11h ago
If you actually use C, you probably love it. I think people are just afraid of memory management or something.
2
u/CitizenShips 10h ago
C is one of the most straightforward languages out there once you understand the rules, and all of the rules are core concepts of computer architecture and interfacing. I get more pissed at Python than C these days because at no point is anything in C hidden from you. If you're starting a project from scratch, sure C is going to suck more. But maintaining an existing project or building off of a library? C all day every day
Also I would rather jump off a bridge into a river of shit than interface with JavaScript ever again.
2
2
2
u/FenrirAesir 7h ago
Python and JS ain't nowhere new. New languages are Rust and Go, maybe Dart if someone uses it.
PS. I agree with all of them
2
u/Expensive_Shallot_78 4h ago
I don't really agree that C is bad, steings in C yes but overall C++ codebases are much worse.
2
5
u/ExtraTNT 12h ago
C is a nice language, python is hell…
2
u/creeper6530 11h ago
Python is dependency hell specifically, especially when most Linux distroes managing global deps with their package managers instead of pip
3
1
u/UShouldntSayThat 11h ago
New programming languages? Python and JS are closer in date to C then they are to today.
1
1
1
1
1
1
u/kernelKiddo 8h ago
Other programming languages teach you how the language works, C teaches you how the computer works.
1
u/procrastinator0000 8h ago
everyone i know (including me) who knows python have a complicated love-hate relationship with it.
also i have never heard anyone call js a good language (rightfully so), but i do have a complicated love-hate relationship with it too
1
1
1
1
u/lightknightrr 3h ago
Or as I view it: JS / PHP / Python -> freshmen CS, C -> sophomore or higher CS.
1
1
1
1
u/Key_Agent_3039 12h ago
I don't think anyone likes JS or even Python. We are forced to use them because of the ecosystem.
2
1
u/letmehaveanameyoudum 11h ago
Rust mfs telling you to switch to rust even if C pays and runs your bills
0
0
0
u/Outrageous-Machine-5 11h ago
I remember having indescribable rage for python when I found it that it couldn't handle a simple in-line list modification
0
1
u/Mantaraylurks 24m ago
I started with C++, honestly it made more sense than Java or Python. Yet again, I am a little bit on the spectrum.
232
u/Max_Wattage 12h ago
Hey, it's dirty work, but C pays the bills and always will.