4 ms·
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 objec
by card_zero 9mo ago
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.
- direwolf20 9mo agoContrary 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.
- Yokohiii 9mo agoThat'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.
- direwolf20 9mo agoOOP doesn't mean that your language has a "class" keyword, nor dot notation for calling functions.
- afiori 9mo agoI enjoyed the pragmatic historical definition of OOP given in https://www.youtube.com/watch?v=wo84LFzx5nI https://www.youtube.com/watch?v=wo84LFzx5nI where essential it can be seen as subtype polymorphism
- flohofwoe 9mo ago> 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 ;)
- direwolf20 9mo agoIt 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.
- vadersb 9mo agohow is OOP dead if tons of code keep being written using OOP these days? From anything corporate in Java/C# to Hyprland C++
- pjmlp 9mo agoWhat modern GUI in mainstream OSes isn't using OOP? Have you bothered to look how GCC and clang are implemented?