The topic says it all I guess.
Well to give you a bit of a background. I have lately been downloading and trying a whole load of different libraries, which I consider using in a project of mine. For now it is no more than a vague Idea floating around somewhere within the creative juices in my brain.
These libraries are all great and I really appreciate that people have done that work in order to share it with others like me, who have less of an understanding of the subject these libraries adress.
One thing I really enjoy about it, is that these people give me a pretty easy interface most of the time, so I don't have to care about the interior of the libs I am using.
On the other hand however, this is exactly the thing that bothers me about it.
Can I use other people's code efficiently, without knowing what it looks like under the hood? This is the purpose of Object oriented programming after all, isn't it?
Plus I might need special functionality that the author of the library has not implemented. A thorough understanding of his code would be necessery in this case in order to adjust the library's functionallity according to my wishes.
And that is where the trouble begins. I tend to be very bad at reading other peoples code. At least when there are no lengthy explanations like on the wiki and when it gets longer than a few lines. (which it rarely is on the wiki either.)
It is even worse. Code which I did not write scares me somehow.
I have never even attampted to have a proper look at ogre's code for instance. Even though Ogre has a great documantation I sometimes feel the wish to know more about certain parts. I do not want to adress the forums everytime I happen to run into an issue which I cannot solve directly by looking at the wiki.
(Of course I love the ogre community. The forums are great and people tend to answer each of my questions very competently. It is just that I don't want to go on anyone's nerves
It is my understanding that reading the code would be the best way to solve each and every problem, as one would not only know what to do (as you would by looking it up in the forums/wiki), but as well why you do this specific thing.
But as I said. When I open a project and the first thing that comes upon me is a wall of macros (I am not saying this is the case with Ogre... never really looked at it) I tend to loose all motivation to keep going.
Another thing is wrapper libraries. I like the fact that things are made as easy as possible for me. But again, if I really had the desperate need to adress a very specific part of the wrapped class I would be more or less lost at this point.
I feel like using interfaces and not knowing what's beyond makes me kind of dumb and inflexible.
One last point I'd like to mention. Often enough it is a small thing I want to solve, but searching for a certain class leads to a run up an incredibly long inheritence ladder, throwing in tons of other classes and functions, which seem to be there only for one purpose... confusing me
So the question is, how would one best go about finding very specific things without having to read ALL the code.
Ok. I could certainly keep going like this for hours. But that would not do me any good and would certainly only discourage people from reading the whole thing.
So let me summarize and finally put my questions:
Other people's code is a great thing to have (especially for free),
as they have already done most of the "dirty" work for you. Sometimes however one feels the desire or the need to actually understand what this dirty work looks like.
Other people's code is often enough a scary thing as well when you attempt to understand it. This is even more true for a C++ novice like myself.
So, does one really need to understand it? How deeply does one generally have to dig into it? Is it recommendable (even if applicable) to use it without EVER knowng what exactly it does.
When you read the code of others, how do you go about it. Just dive in with the class you want explained and then do it the hard way, gathering the bits and pieces as you go? Or do you do it more organised? (API references come to mind)
I am pretty well aware that I do not need to understand every little detail of the libs I am using. That's what they were created for after all.
However I often feel like missing something when I just dumbly obey to there rules without ever questionning, let alone understanding them.
Sure I do not need to know how exactly a car works to use it for my purposes. I just need to understand the interface.
But then again, I am not intending to build or modify my car (in which case I would need to know some if not all of the details).
Hope this metaphor (is it a metaphor?
To anyone who had the patience to read that monster of a text. If you still have enough power left to write something helpful, you are highly encouraged to do so.
Thanks,
Ed.
