Why I Write Games in C (yes, C)
jonathanwhiting.com
Why I Write Games in C (yes, C)
1–10 of 556 posts
Re: Why I Write Games in C (yes, C)
#2> "C is dangerous, but it is reliable. A very sharp knife that can cut fingers as well as veg, but so simple it's not too hard to learn to use it carefully."
Cliche analogy.
Re: Why I Write Games in C (yes, C)
#3Write C code. Compile with C++ compiler. Catch lots of bugs at compile time.
Re: Why I Write Games in C (yes, C)
#4I 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)
#5So... essentially "I know and like C". Which is great! But as you say, that's not particularly useful for anybody else.
Re: Why I Write Games in C (yes, C)
#6Write 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!
Re: Why I Write Games in C (yes, C)
#7Write C code. Compile with C++ compiler. Catch lots of bugs at compile time.
Yeah use the few features that are beneficial, ignore the rest.
Re: Why I Write Games in C (yes, C)
#8Write 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)
#9Write C code. Compile with C++ compiler. Catch lots of bugs at compile time.
[deleted]
Re: Why I Write Games in C (yes, C)
#10There'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.