How do programmers know what's inside my custom library?

Aug 4, 2017 at 11:25pm
After I created a graphic library for example and then if I want to distribute it to other people to use, how do they know how to use my library and what's inside it? How do they access my functions and classes if I don't give them the source code?

Aug 5, 2017 at 12:17am
You give them the header files for your accessible classes and methods. Of course you also have to provide documentation so they know how to use it.
Aug 5, 2017 at 2:56am
So if I give them the header file and documentation, why not just give them the source code?
Aug 5, 2017 at 4:51am
You wouldn't give them the source code for the same reason that any library doesn't provide the actual source code. At best, it's not required - at worst, it gets tampered with.

Typically, your "library" contains header files (which do not contain any implementations) and most likely a static library file (.lib), with which they can link their project.
Aug 5, 2017 at 10:23am
So if I give them the header file and documentation, why not just give them the source code?

Because in your source files there are those brilliant algorithms and solutions which make your code so more efficient than others’ one that it will make you the richest programmer on Earth, whereas in your headers there’s only the description of what your code does, not how.

(I’m in favour of giving source code too, anyway)
Last edited on Aug 5, 2017 at 10:23am
Aug 5, 2017 at 10:30pm
Thanks friends for your answers.
Topic archived. No new replies allowed.