Live data from Hacker News

Ask HN: Why do so many developers dislike C when I find it inspiring?

news.ycombinator.com

11–20 of 42 posts

Re: Ask HN: Why do so many developers dislike C when I find it inspiring?

#11
post #2

For simple things I also like shell scripts. But for bigger more complex systems, especially with long life-times, many users and many developers, the sharp edges get too dangerous. In those case I move to Java or at least something with stronger typing, and less chance of memory management errors. My last big project was 100kloc C/C++ in a radiator valve though. Not many languages with a run-time would have fit in t…

I think that's the beauty of C — it lets you fit logic into 32kB without screaming. For me it's not about "modern safety" — it's about knowing that every byte is mine. But yeah, I get the tradeoff when you’ve got teams, timelines and a JVM.

I still use C to write little programs for Ardunio but it drives me nuts thinking about all the useless stuff C is doing with the stack and calling convention when I could just use global variables for everything and sometimes even use nothing but registers for inner loop variables.

I stick with C because (1) I'd have to figure out the tooling for 100% assembly development on AVR-8, and (2) C is portable to other platforms so if I want to migrate to an ARM or ESP-32 board it would be easy. (The upward migration path for AVR-8 is to go to a soft core on an FPGA but talk about frying pan to the fire)

Re: Ask HN: Why do so many developers dislike C when I find it inspiring?

#12
post #10

Earlier quoted context omitted.

I think that's the beauty of C — it lets you fit logic into 32kB without screaming. For me it's not about "modern safety" — it's about knowing that every byte is mine. But yeah, I get the tradeoff when you’ve got teams, timelines and a JVM.

BTW you can get very close to the metal in Java too if you are so inclined - I was part of a team doing high-speed trading with microseconds timing and minimal GC in Java. A very few 'unsafe' lines made that possible (but also the possibility to crash the JVM far far faster than it could exit otherwise!)...

That’s fascinating. I never thought Java could get that close without tripping on GC. Must’ve taken a lot of careful design and deep understanding.

I’d honestly love to read more about setups like that — maybe in my quiet hours. Feels like something worth studying, even if I keep walking the C path for now.

Re: Ask HN: Why do so many developers dislike C when I find it inspiring?

#13
I also like C, for reasons you mention. I dislike many of the features of other more modern programming languages (even if they do have some advantages, many of the things they do are not as good in my opinion, so I prefer C programming).

Re: Ask HN: Why do so many developers dislike C when I find it inspiring?

#14

Earlier quoted context omitted.

I think that's the beauty of C — it lets you fit logic into 32kB without screaming. For me it's not about "modern safety" — it's about knowing that every byte is mine. But yeah, I get the tradeoff when you’ve got teams, timelines and a JVM.

I still use C to write little programs for Ardunio but it drives me nuts thinking about all the useless stuff C is doing with the stack and calling convention when I could just use global variables for everything and sometimes even use nothing but registers for inner loop variables. I stick with C because (1) I'd have to figure out the tooling for 100% assembly development on AVR-8, and (2) C is portable to other pla…

Yeah, the stack can be such a headache. I remember how much pain I went through just trying to wrap my head around it — even gave up a few times.

But then I’d cool down… and come back to it. Some languages just never “clicked” for me, but somehow I keep coming back to C.

Re: Ask HN: Why do so many developers dislike C when I find it inspiring?

#15
For me it’s because I enjoy building useful things more than I enjoy futzing with the details of code. I could build something useful in C. Or I could spend the same amount of time building a dozen useful things in Python. With the added benefit that they’re less likely to segfault.

WHY does it matter to you to be that close to the machine? For many of us, we value different things. What you perceive as control, we perceive as fussiness.

Re: Ask HN: Why do so many developers dislike C when I find it inspiring?

#16

I also like C, for reasons you mention. I dislike many of the features of other more modern programming languages (even if they do have some advantages, many of the things they do are not as good in my opinion, so I prefer C programming).

I’m really glad to hear that. It’s easy to feel alone in that view these days — but the more I talk to people who build things close to the metal, the more I realize we’re not as rare as it seems.

I remember trying Python once — it didn’t click. Then C++ — and when I hit memory management, I didn’t turn away… I got curious.

So I looked deeper — into C. And somehow… I stayed.

Thanks for sharing that.

Re: Ask HN: Why do so many developers dislike C when I find it inspiring?

#17

For me it’s because I enjoy building useful things more than I enjoy futzing with the details of code. I could build something useful in C. Or I could spend the same amount of time building a dozen useful things in Python. With the added benefit that they’re less likely to segfault. WHY does it matter to you to be that close to the machine? For many of us, we value different things. What you perceive as control, we p…

I think if you learned to program 20 years ago or more you're likely to be faster at C than Python unless you jumped on Python in the Python2 days or earlier.

For me it's pretty hard to get in the flow with Python because I keep having to stop and read the documentation. I think this is just a personal thing but it's possible that Python may just be a significantly more complex language and that's driving some of it. I'm sure I'm not the only one like this.

There was a string heavy app I wrote years ago and I had multiple false starts in Python and then one day I just said "this needs to get done" and plowed through it in C nearly one shot in a couple hours. I've experienced this kind of thing multiple times. It's a little hard to really communicate how this feels.

EDIT: Yeah I think it really depends. I certainly do a lot of heavy numerical/ML stuff in Python just because that's where the libraries are (and IMO the libraries being written in python isn't a coincidence, it's a fantastic language for that.)

It's not just "string handling algorithms" though. I've written an entire web browser in straight C and it was mostly just walking through standards and coding. Maybe some of it is familiarity but I think part of the lack of familiarity comes from C just not having complex built-in data structures. There's no hashmap in C. There are no iterators in C etc. There's a tiny standard library to become familiar with and that's about it.

Re: Ask HN: Why do so many developers dislike C when I find it inspiring?

#18

For me it’s because I enjoy building useful things more than I enjoy futzing with the details of code. I could build something useful in C. Or I could spend the same amount of time building a dozen useful things in Python. With the added benefit that they’re less likely to segfault. WHY does it matter to you to be that close to the machine? For many of us, we value different things. What you perceive as control, we p…

That’s a really fair question.

For me, it’s not just about building tools — it’s about understanding what I’m building.

I like knowing where the bytes go. What the memory looks like. How the binary behaves. It slows me down, sure — but it teaches me things I didn’t even know I didn’t know.

I’m not building for scale or clients. I’m building to see.

That kind of closeness makes the machine feel less like a mystery, and more like a partner.

Re: Ask HN: Why do so many developers dislike C when I find it inspiring?

#19

I also like C, for reasons you mention. I dislike many of the features of other more modern programming languages (even if they do have some advantages, many of the things they do are not as good in my opinion, so I prefer C programming).

I really don't like how they always try to do everything on the heap. Realizing how memory worked in Rust was a pretty major letdown given how it's sold.

Re: Ask HN: Why do so many developers dislike C when I find it inspiring?

#20

Earlier quoted context omitted.

I think that's the beauty of C — it lets you fit logic into 32kB without screaming. For me it's not about "modern safety" — it's about knowing that every byte is mine. But yeah, I get the tradeoff when you’ve got teams, timelines and a JVM.

I still use C to write little programs for Ardunio but it drives me nuts thinking about all the useless stuff C is doing with the stack and calling convention when I could just use global variables for everything and sometimes even use nothing but registers for inner loop variables. I stick with C because (1) I'd have to figure out the tooling for 100% assembly development on AVR-8, and (2) C is portable to other pla…

The 100kloc thing had no malloc/free, ie most significant persistent data objects were static, and the inlining with LTO (and some help) was pretty intense, so the stack was used, but not as much as it seemed on the surface. We did (re)invent some carefully managed buffers shared through several levels of call, since we were doing, for example, AES-GCM: https://github.com/opentrv/OTAESGCM
Post reply on HN