Live data from Hacker News

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

news.ycombinator.com

21–30 of 42 posts

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

#21
post #6

Earlier quoted context omitted.

I want to amplify this. It isn't just that we don't trust you personally or something at your current level of development. It is that we have seen all the smartest people use C, augment it with all manner of static analysis tools, develop endless "technically this is a C dialect and not C" practices like making bespoke rules about how and when to allocate and how to deal with recursion... ... and they still write pr…

I truly appreciate the depth of your response. I can see that it comes from long experience and serious thought. I don’t claim to be immune to the sharp edges of C. I’ve already cut myself more than once. Maybe I’m bleeding now and don’t even know it yet. But there’s something in me that still wants that control — even if it hurts. I’m not building for clients or large teams. I’m building for myself with intention. M…

"But there’s something in me that still wants that control"

There are many modern languages that give you control without giving you the grotesquely unsafe constructs that C gives you. You don't need to pervasively be able to access arrays out of bounds. You don't need to pervasively be able to do arbitrary pointer arithmetic. Even if you do need to fool with that stuff you can always do it in some unsafe block. We've built methods that give you the control you need without the control you don't need.

Alternatively, consider learning assembler. No joke. While theoretically all my complaints apply only moreso, assembler has the advantage that being "the language we speak to the CPU with" means that it will always still have some use until such time as we switch CPU architectures. At least in the assembler world you know you're juggling lit torches all the time.

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

#22
post #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.

I’ve heard similar thoughts from others who went into Rust expecting something radically freeing — and found themselves wrestling with the borrow checker and unexpected heap usage.

I still want to explore Rust at some point, but I think it’s important to hear real experiences like yours.

Sometimes the simplicity of C — for all its sharp edges — feels more honest.

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

#23
post #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 was taught in C. Over 20 years ago. I’m massively faster in Python, and have been since about 6 weeks after I picked it up.

It sounds to me like part of that for you is about familiarity and another part might be about the specific problems you’re solving.

I’m usually working on solving problems at much higher levels of abstraction than string processing algorithms. For me, a big part of Python’s productivity is its ecosystem of useful abstractions (there’s an XKCD for that). And not having to worry about memory management or null pointers. How powerful exception handling is. Etc.

Python may in some ways be a more complex language, but I find it much simpler to reason about.

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

#24
post #21

Earlier quoted context omitted.

I truly appreciate the depth of your response. I can see that it comes from long experience and serious thought. I don’t claim to be immune to the sharp edges of C. I’ve already cut myself more than once. Maybe I’m bleeding now and don’t even know it yet. But there’s something in me that still wants that control — even if it hurts. I’m not building for clients or large teams. I’m building for myself with intention. M…

"But there’s something in me that still wants that control" There are many modern languages that give you control without giving you the grotesquely unsafe constructs that C gives you. You don't need to pervasively be able to access arrays out of bounds. You don't need to pervasively be able to do arbitrary pointer arithmetic. Even if you do need to fool with that stuff you can always do it in some unsafe block. We'v…

Thanks — I actually plan to start learning assembler this fall. Not for pain, but for deeper understanding.

Step by step, I want to get closer to what’s really going on.

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

#25
post #17

Earlier quoted context omitted.

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 was taught in C. Over 20 years ago. I’m massively faster in Python, and have been since about 6 weeks after I picked it up. It sounds to me like part of that for you is about familiarity and another part might be about the specific problems you’re solving. I’m usually working on solving problems at much higher levels of abstraction than string processing algorithms. For me, a big part of Python’s productivity is it…

Yeah, I think you’re right — Python really shines in many areas.

Honestly, a lot comes down to the person, the kind of problems they solve, their mindset… and sometimes, their scars.

I don’t even fully know why Python didn’t click with me. I understood it. I saw how fast it can be. But for some reason, I kept drifting back to C.

Maybe it’s just how my brain works. Maybe it’s where I found meaning. Hard to explain.

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

#26
post #17

Earlier quoted context omitted.

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 was taught in C. Over 20 years ago. I’m massively faster in Python, and have been since about 6 weeks after I picked it up. It sounds to me like part of that for you is about familiarity and another part might be about the specific problems you’re solving. I’m usually working on solving problems at much higher levels of abstraction than string processing algorithms. For me, a big part of Python’s productivity is it…

> For me, a big part of Python’s productivity is its ecosystem of useful abstractions

Yeah the huge amount of libraries that are readily available and can be used right away without messing with a complex build system is a huge deal.

For me personally, C# is like the middle ground. A language I like much better than Python but also has a fairly rich ecosystem, and usually nuget makes including dependencies easy.

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

#27

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…

I've been trending towards "C with namespaces" for Arduino on AVR-8.

With namespaces you can have globals and few collisions. At the expense of more typing, of course.

You do know about the "register" storage class/keyword, I am sure. Sometimes it works.

Edit - the tooling for AVR assembler seems to be avr-gcc and make. Check out Nerd Ralph's "ArduinoShrink" library for an example of blended C and assembler:

https://github.com/nerdralph/ArduinoShrink/tree/master

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

#29

Earlier quoted context omitted.

I was taught in C. Over 20 years ago. I’m massively faster in Python, and have been since about 6 weeks after I picked it up. It sounds to me like part of that for you is about familiarity and another part might be about the specific problems you’re solving. I’m usually working on solving problems at much higher levels of abstraction than string processing algorithms. For me, a big part of Python’s productivity is it…

Yeah, I think you’re right — Python really shines in many areas. Honestly, a lot comes down to the person, the kind of problems they solve, their mindset… and sometimes, their scars. I don’t even fully know why Python didn’t click with me. I understood it. I saw how fast it can be. But for some reason, I kept drifting back to C. Maybe it’s just how my brain works. Maybe it’s where I found meaning. Hard to explain.

Ultimately, there are no right and wrong programming languages (except Visual Basic, lol, or maybe PHP 3). Sometimes a language is wrong for a specific project, but there’s nothing wrong with any particular language preference. I find it hilarious that there have been flame wars over the topic. So if you ultimately find more meaning or enjoyment in writing C code… sure, it’s not for everyone, but it’s awesome that you’ve figured out what you like!

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

#30

Earlier quoted context omitted.

I was taught in C. Over 20 years ago. I’m massively faster in Python, and have been since about 6 weeks after I picked it up. It sounds to me like part of that for you is about familiarity and another part might be about the specific problems you’re solving. I’m usually working on solving problems at much higher levels of abstraction than string processing algorithms. For me, a big part of Python’s productivity is it…

> For me, a big part of Python’s productivity is its ecosystem of useful abstractions Yeah the huge amount of libraries that are readily available and can be used right away without messing with a complex build system is a huge deal. For me personally, C# is like the middle ground. A language I like much better than Python but also has a fairly rich ecosystem, and usually nuget makes including dependencies easy.

That’s a great point — C# really does hit a sweet spot between control and convenience.

I’ve never spent serious time with it, but I’ve heard a lot of good things about the tooling and the ecosystem.

Maybe one day I’ll give it a try — especially if I ever need something with more abstractions but less ceremony than Python.

Thanks for sharing your take — it’s always helpful to hear how others find their flow.

Post reply on HN