Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What is with all the C hate on hackernews these days. I would love to go back to coding in c. Just once you program in Java it is very hard to be productive in c again.


The article isn't really about C programming, it's about C's type system being used to define ABIs for foreign-language function calls. The size of e.g. an int can vary from platform to platform. Structure layouts are also platform-specific. Looking at a C library's header file by itself tells you nothing about what to actually put in the registers.

I'm unclear on whether it would have been possible to do better without an implausible amount of standardization early in computing history. A low-level language that works on CPUs with different endianness and word size and pointer size and number of registers is by necessity going to be somewhat vague about calling conventions.


I don’t see hate here. Just disappointment, from programmers who used to like C and feel like it has let us all down.


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.


No idea.

I also love programming in C! I even went so far as to write a metaprogramming layer so I no longer have to use cxx templates for generics. It's such a delightfully simple language that really sparks the Joy of Programming in me


Absolutely right there with you, in terms of joy per minute spent writing code, C wins for me by a huge margin. Every time I write C I end up making at least one thing that puts a genuine smile on my face.


I also enjoy a bit of green-field coding in C.

https://www.humprog.org/~stephen/research/papers/kell17some-...


It's the new "I hate Emacs" / "I hate Tabs". Nerd sites used to be flooded with posts whining about one or the other, in between posts complaining about Microsoft.


I prefer C for microcontrollers. Things are much more predictable as far as how much memory, stack space, and roughly how many processor cycles you're using for anything.


I love the aesthetic of coding in C. Too bad it sucks.


I see that get expressed a lot here. I think its largely bandwagon opinions from people who haven't used it.


People who only learned programming with managed code have a general disdain for anything different.


I think you can broaden that to people who experience things that are different generally disdain those differences.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: