Personally, I feel like the public/private/protected/friend (data &
code hiding) tenet of OOP is the least beneficial. I get that it
helps make the interface contracts stronger, but that's only a concern
for me in languages that don't have strong or static typing. Simple
Inheritance (object extension), Encapsulation (grouped data and
related code), and Polymorphism (shared interfaces) are much more
beneficial. A better treatment for OOP in C, IMO, is "Object-Oriented
Programming With ANSI-C" [0][1].
[0]
http://www.cs.rit.edu/~ats/books/ooc.pdf
[1]
http://www.cs.rit.edu/~ats/books/ooc-14.01.03.tar.gz
On Wed, Nov 26, 2014 at 1:38 PM, Charles Thorley <charles_AT_thorley.us> wrote:
> THIS IS NOT A TROLL
>
> I understand that there is zero love for object-oriented programming
> methodologies on this list, and I am not particularly interested in this
> strategy myself, although some languages that I like (i.e. Python) make
> it hard to avoid in many ways. Regardless, this question is not meant
> to poll suckless devs on their feelings surrounding baroque,
> masturbatory abstraction; I know the answer to that question.
>
> I am attempting to learn C, and in my interweb travels I have
> encountered Object Oriented C. One particular theme surrounding this
> approach, which I found quite interesting, was the idea of creating safe
> and robust interfaces through (relatively?) simple means; namely,
> modeling the public/private metaphor in OOP by placing
> differently-privileged code in separate files, and managing access
> through header files. A link that describes this technique:
>
> http://www.embedded.com/electronics-blogs/object-oriented-c/4397794/Object-oriented-C-is-simple-
>
> I know just enough about programming to be intrigued by the idea, but
> not nearly enough to understand its implications in practice. My
> questions are:
>
> 1. Is this practice (potentially) suckless?
> 2. If so, under what conditions would this be a suckless strategy?
>
> My apologies if this has been covered previously; googling the list did
> not suggest that this is the case, although my attempts to learn C have
> revealed that my google-fu has a giant blind spot when it comes to
> producing useful results for single-character keywords.
>
Received on Wed Nov 26 2014 - 23:07:22 CET