Live data from Hacker News

Why I Write Games in C (yes, C)

jonathanwhiting.com

1–10 of 556 posts

Re: Why I Write Games in C (yes, C)

#4
I get that this is not a popular opinion these days, but I like C. Quite a bit, actually. I can get stuff done reasonably quickly, don't have to futz around with multiple inheritance (C++) or where to call out to C anyway (python). There is so much more tooling behind C than Rust, or Go, or Zig (though I've been looking at Zig as a replacement). C isn't as bad as everyone makes it out to be, for personal stuff. I'd be a little more careful in group projects, but there's a reason it's still around. You do have to be careful and do a good design, but you should be doing a design anyway.

Some day, C will be deposed. Something better will show up and gain traction. On that day, I will happily switch to the new better thing; but for now, C meets my requirements pretty well.

Re: Why I Write Games in C (yes, C)

#8
post #6
post #3

Write C code. Compile with C++ compiler. Catch lots of bugs at compile time.

Or even better, compile with a C compiler with proper flags set (like -Wall). Catch lots of bugs and also enjoy blazing fast compile time!

Compilation speed for C++ is a function of the complexity of the code being compiled (particularly templates), otherwise a C++ compiler will typically compile C code (if it is compilable) at the same speed as a C compiler.

Re: Why I Write Games in C (yes, C)

#10
There's one important question left out: what kind of games does the author make? I can see how 'vanilla' C can be more than sufficient for basic 2D games, but as soon as you grow in complexity it can quickly become an insurmountable task to grok.
Post reply on HN