3 ms·
That's funny about capsules. More consistent when people discuss encapsulation, though. Far as OOP in C, it's definitely doable with quite a few approaches and
by nickpsecurity 10y ago
That's funny about capsules. More consistent when people discuss encapsulation, though. Far as OOP in C, it's definitely doable with quite a few approaches and even books dedicated to it. Example:
https://www.cs.rit.edu/~ats/books/ooc.pdf https://www.cs.rit.edu/~ats/books/ooc.pdf
Many think C++ with its benefits and problems are relevant to OOP in C but not entirely. That's because they think C++ was about adding OOP to C. It wasn't. Stroustrup used safe, OOP languages like Simula that he wanted more of. He intended to leverage C's popularity and tooling but transform it into something with benefits of other languages. So, the result is C-like but not quite C and complex.
Just doing OOP in C, on other hand, is much easier and cleaner problem to solve. ;)