I wrote an article on how to fake real classes in pure C without using C++
I just published an article that turned into one of the most interesting things I have written in a while.
The idea is simple but fun: how do you get class-like behavior in pure C, without using C++ at all?
C is usually seen as a very low-level, direct language. That is exactly why I liked digging into this. I wanted to show that even in plain C, you can still build something that feels a lot more structured and object-oriented if you understand the language well enough.
In the article, I break down one simple trick that makes this possible and explain it in a practical way, not just as a theory dump. If you enjoy C, systems programming, or just like seeing old-school languages do clever things, you might find it interesting.
Article is attached in the comment.
I would genuinely love feedback from people who work with C or have tried similar approaches. What do you think about using this kind of pattern in real projects? Would you use it, or avoid it and keep things more traditional?