Hacker News new | past | comments | ask | show | jobs | submit login

I love C because it’s so minimal.

And it’s not a dead end at all - embedded systems, wasm, wasi, really fast things, and aside from assembly it’s one of the first things on newer platforms (risc v for example).

I like Go for the same “try to keep it minimal” reasons, and keen to try Zig when I have some time.

I think the bias you are implying might be misplaced.




The problem with C is that its... kind of minimal, but it also needs tons of extensions to get things done.

Want multiple heaps? That'll be a compiler extension. Want to specify exactly where a variable is laid out in memory? Compile extension.

Have a memory layout that isn't just a flat map of address space? Better reach for a compiler extension.

Hardware registers? Eh, overlay it with a union or a struct or something, it'll be fine. Unless you want some sort of non-trivial typing on those registers.

People forget that C is written against an abstract C machine. C is not written against the underlying hardware platform. And the abstract C machine may differ from your target hardware by a fair bit.


> Want multiple heaps? That'll be a compiler extension.

That sounds like a library, not a compiler extension.


True enough, C doesn't care much about how allocation is done.

Which is part of the problem! Ugh.


Why would C be the requirement for “really fast things”? It doesn’t even have any support for SIMD instructions other than going inline assembly.


Using intrinsics is much more sensible option than dropping to inline asm. Each CPU with SIMD or any kind of specialised instructions provides an intrinsics library for C.


Which, correct me if I'm wrong, is also a compiler extension.


C is a great language. Actually it's not that small, it's just that modern languages often are very big (easy if you compare yourself to C++). The feature bloat is a fairly recent trend.


"C is faster/smaller/... than C++" hasn't been true in a long time.

I would argue that the time you need to invest to get something done correctly in C is a cost you can avoid with (modern) C++


Personally, I don’t like C++ - maybe it’s the friends function or templating or the usual build systems… and it’s not small by a long shot. My opinion is not really based objectively, I just don’t like it.

If I wanted / needed something more oo I’d probably learn rust.

C++ is everywhere doing amazing things so hate - unreal engine! - just really not my cup of tea.


C++ compile times would like to have a word with you ;) The biggest drawback of C++ are the atrocious compile times.


Are you serious?

I mean, of course, I also like short compile times... but since when are they considered a serious cost? What are we talking about? Seconds? Minutes? Hours?

Are you using your compiler as a syntax checker? Always compiling everything all the time?

Especially since you compile once, what you run a million times and now that everyone is running around with what would have been considered a supercomputer decades ago in their backpack, and a half in their pocket.

Of course I think stuff should compile fast (that's why we use Make, CMake, ninja, etc.) but I would never chose C over C++ because of compile times... Code that requires high mental load and solving the same stupid things again, and again, and again... still costs more time than my compiler can get me back IMO.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: