News for hackers. Stuff that matters.
Re:Why I Write Games in C (yes, C) by seamyb88 on Saturday September 21, 2019 @03:26PM (#21037350)
Some people just like writing code. You can't say that C's features are insufficient, when you can implement the vast majority of C++ features in native C, and all of 'em with tooling. What's wrong with having direct control of only the features you need? What's wrong with code generation? Not to trample on C++, I like it (albeit less than C). I would definitely create C++ if it didn't exist.
Re:Why I Write Games in C (yes, C) by einpoklum on Saturday September 21, 2019 @05:14PM (#21037965)
> when you can implement the vast majority of C++ features in native C

No, you absolutely cannot, even in principle. C++ is not "C with classes" and some syntactic sugar like it started out. That's not been the case for many years already.

Also, even the features you can implement - you won't; you don't have the person-years for that. You will have to, need to, use libraries. For those you need to compare the libraries available for C and for C++, and C comes up quite short (not just because C libraries are also usable in C++...)

Re:Why I Write Games in C (yes, C) by seamyb88 on Saturday September 21, 2019 @06:49PM (#21038375)
So which feature can you not implement? The only I can think of which you'd have real problems are anonymous functions/lambdas. Most other features I think you can implement. It won't look the same, but it will serve the same purpose.
Re:Why I Write Games in C (yes, C) by johannes1234321 on Saturday September 21, 2019 @08:56PM (#21038931)
Things coming to mind:

Pointers which can't be NULL (aka. references)

Exceptions which also clean up intermediate frames (the exception itself can be done with longjmp, but no destructors which could be run)

Re:Why I Write Games in C (yes, C) by megous on Saturday September 21, 2019 @10:23PM (#21039238)
Pointers that can't be null are usually implemented by struct embedding. That's typical for Linux kernel code, for example.
Re:Why I Write Games in C (yes, C) by ncmncm on Sunday September 22, 2019 @04:52AM (#21040356)
Destructors. It is the defining feature of the language; everything else in the language extends their reach. They are the key to full exercise of code paths, and thus reliable code.

A programmer who makes full use of destructors is simply a better programmer than one who doesn't.

Re:Why I Write Games in C (yes, C) by lightedman on Saturday September 21, 2019 @06:07PM (#21038188)
"No, you absolutely cannot, even in principle."

Which is why it has been done for my 2D Second Life clone?

Some of us can very easily implement C++ stuff in native C.