To view parent comment, click here.
To read all comments associated with this story, please click here.
And that objects inherit functions from their parents. For example, if I have a GtkRadioButton I can call GtkButton and GtkWidget methods on it, because they're both parents.
I've not tried getting too crazy with this, but it's generally worked for me so far. I'm guessing it breaks down somewhere, and I'm sure the enforcement of the OO nature is by hand; but yes, you can write OO stuff in c. And Gtk is a very good example.
A hello world program in c would be simply sending a pointer to the first character of the string and the print function prints until it hits . It's not showing any kind of inheritance, data hiding, or anything like that; so it's not object oriented.
I don't know what you're talking about with this "string object" idea. It's just a series of bytes on the program stack...
Object Orientation is a very abstract thing, and I've had it twisted against me many a time in arguments, which is why I prefer to define what I'm talking about beforehand. Object Oriented doesn't imply another other than being "oriented" around "object", neither of which is very descriptive. As far as I know, there is no definition of OO, and it's doubtful there ever will be as there are so many different versions.
It's not showing any kind of inheritance, data hiding, or anything like that; so it's not object oriented.
None of those are intrinsic properties of OO.
I don't know what you're talking about with this "string object" idea. It's just a series of bytes on the program stack...
So is any other type of data, which is where you miss the point. OO isn't data, it's how you look at it and treat it. Unfortunately, the general definition of "OO" tends toward strict and overcomplicated designs with lots of extra crud slopped on top of the code.
-bytecoder





Member since:
Only in the sense that "objects" (aka structures) are used to represent widgets. If you want to stretch it that far, you might as well call hello world in C object oriented, because you're 'sending' the puts message to the string object.
-bytecoder