• xiii@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    4 hours ago

    I was working on a C code base with classes, inheritance, and polymorphism, all done by hands and macros.

    Something like

    typedef struct s_some_class {
        void (*method)(this *s_some_class);
    } t_some_class;
    

    Overall, learning C was the best enabler in my whole career. For instance I was learning Python by tinkering with CPython VM, so when I see these ‘WAT’ quircks I know exactly what’s up.

    • bestelbus22@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      ·
      4 hours ago

      Interesting, how did they do inheritance? Something like void *super? Also why not switch to CPP if you wanna do OOP?