Hacker News new | ask | show | jobs
by Hemospectrum 1322 days ago
I don’t see hate here. Just disappointment, from programmers who used to like C and feel like it has let us all down.
2 comments

Most of the hate comes from people that have never written a line of C in their professional life.
I didnt hate C until Ive been moved to C world and realized how basic things in other langs arent trivial in C
I had the exact opposite experience, starting out mostly coding in high level languages moving to C as the language I use day-to-day I realized how incredibly limited I was by the abstractions I was saddled with.
This didn't make me hate C, but it did make me appreciate every other language.

The spartan nature of the language itself, and all of the inevitable difficulties around linking has really made nearly everything else seem so much more simple.

Using nice string and algorithm libraries helps a lot without introducing all the craziness of cpp.

You can also do zig style memory management (ex: allocator pools per request etc) which helps.

There's something to be said for making it at least a little painful to e.g. concat strings in a loop or swap an integer value in an array for 500KB of raw JSON.
IMO this is not hating C the language, but C the platform. Every OS and non-C language has to deal with that.
The reason C is everywhere is because it doesn't define a platform. The OS/hardware makers define it.

Lack of a platform is a strength.

I don't feel like I've ever been let down by C. In what way has C let you down?

I almost feel the opposite, C is the only language that has *never* let me down. It's the only one that's always delivered on it's promises, it's the only one that never fights me on what I want to do. It always feels like the sky is the limit. And it's so nice to know that you're the one who's wasting cycles and memory, not the language.

> it's the only one that never fights me on what I want to do

This is the #1 thing I've learned not to like about it.

The problem is simple. How can I trust that code written by other programmers is up to my standards? If the language obediently does anything they want, how am I supposed to judge its quality? Do I have to review every line of code in every piece of software running on every piece of hardware I interact with? Do I have to go around building a complete and accurate mental model of literally any program I plan to use?

I don't have time for that. Nobody does. It doesn't scale.

When other people write software, I want a vigilant, tireless critic to watch them write code and stop them from doing things that are unambiguously stupid. That's the only way to deal with the vast number of programmers with skill levels beneath mine, writing code that threatens to affect my life. If they can't do that with C, I want them to do it with something else.