[sdiy] OBJECT ORIENTED C in synth programming
dan snazelle
subjectivity at hotmail.com
Fri Apr 8 20:16:09 CEST 2011
thanks everybody!
On Apr 8, 2011, at 2:06 PM, Tom Wiltshire wrote:
> Hi Dan,
>
>> So I am wondering....can anyone recommend a good book On Object oriented C? Or on OOP in general?
>
> Sorry, I don't have a good book recommendation.
>
>> Am i correct that object oriented is using structures and classes?
>
> Yep, that's pretty much it.
>
>> The more of this I can understand, the more I will be able to read and hence learn from the code I look at. Even though I dont undestand it yet, intuitively it looks like it makes sense. And I guess this is what Java and C++ are all about?
>
> Absolutely. C++ and (later) Java are both very OO languages.
>
> I'd warn you not to get scared off by some of the terminology you'll come up against, or the apparently sophisticated techniques they rant about (like complicated inheritance schemes and stuff). Mostly you don't need it. I reckon it got a bit out of hand in C++.
> The guts of OOP is that you have little black boxes called "objects" and each object provides functions for other parts of the code to interact with it ("Methods"). The variables associated with the object are all hidden inside the little black box where the rest of the code can't get at them. This makes for reliable code since the object methods provide the only way that variables can be altered - you can't just hack the variables from somewhere else in the code.
>
> It's possible to write code in this style in pretty much any language, so OOP is a discipline as much as anything. I generally write code which is OOP in intent, but rarely do I adhere to all the strictures! Usually there is something that needs doing in the simplest possible way, and adding extra OOP hops to jump through doesn't make life easier.
>
> But C's structs are an extremely useful feature, and give you some of the convenience of objects without tying you into anything. Definitely find out what you need to know about them.
>
> Regards,
> Tom
>
>
>
More information about the Synth-diy
mailing list