News for hackers. Stuff that matters.
Re:I write games in C (yes, C) by card_zero on Saturday February 07, 2026 @08:09PM (#46930263)
C++ reimplements a lot of the things we do in C with function pointers, while hiding what's actually happening behind topheavy syntax that implies a 1990s object oriented paradigm that's dead now.
Re:I write games in C (yes, C) by direwolf20 on Saturday February 07, 2026 @08:14PM (#46930313)
Contrary to popular belief C++ isn't really object–oriented. I mean, you can write object–oriented code, but the language doesn't make assumptions about what goes into a class. It's really just a struct with associated functions.
Re:I write games in C (yes, C) by Yokohiii on Saturday February 07, 2026 @08:24PM (#46930383)
That's an odd opinion about a language with a lot of class related features. I can only assume you have a very strong definition of OOP.
Re:I write games in C (yes, C) by direwolf20 on Saturday February 07, 2026 @09:07PM (#46930626)
OOP doesn't mean that your language has a "class" keyword, nor dot notation for calling functions.
Re:I write games in C (yes, C) by afiori on Sunday February 08, 2026 @03:55AM (#46932597)
I enjoyed the pragmatic historical definition of OOP given in https://www.youtube.com/watch?v=wo84LFzx5nI where essential it can be seen as subtype polymorphism
Re:I write games in C (yes, C) by flohofwoe on Sunday February 08, 2026 @09:41AM (#46934587)
> It's really just a struct with associated functions.

If that were actually true C++ would be a lot easier to accept as a 'C successor'. Instead you have the implicit this-pointer, complicated rules for which constructor or operator overload is actually called, a hidden vtable pointer (not to mention multiple inheritance), then you have public/private/protected, override vs final, const methods (which wouldn't be needed as a separate syntax feature if the this arg wouldn't be implicit) etc etc etc... that a lot of OOP-baggage which a lot of C++ coders probably don't even notice anymore.

A plain C struct with function pointers does indeed make a lot more sense than all the OOP-ism that C++ hides from you ;)

Re:I write games in C (yes, C) by direwolf20 on Sunday February 08, 2026 @10:55AM (#46935384)
It has lots of optional features, none of which make it an object–oriented language. It's an everything–oriented language. It has lambda syntax for functors, but you're not calling it an impure–functional programming language. Virtual functions are one feature, which is useful in pseudo–object–oriented code.
Re:I write games in C (yes, C) by vadersb on Sunday February 08, 2026 @04:44AM (#46932844)
how is OOP dead if tons of code keep being written using OOP these days? From anything corporate in Java/C# to Hyprland C++
Re:I write games in C (yes, C) by pjmlp on Monday February 09, 2026 @02:31AM (#46942563)
What modern GUI in mainstream OSes isn't using OOP?

Have you bothered to look how GCC and clang are implemented?