I am learning c++. So I'm a beginner. But I can't understand why programmers create custom libraries. I can easily get an answer to the question "how", but I can't get an answer to the question Why, I've found two possible reasons:
- Organizing subprograms (completed code pieces to one library) to use in different programms or tools, for example.
- Binary output size.
For organizing functional code blocks, I'd prefer to use git clone instead of a library. For me, it is a more comfortable way to integrate, edit, and use my code in different projects.
About output size: it's a controversial issue. If I use a static library, I don't get a smaller size because, using a static library, my app will be extended by byte code, but using native code, created code blocks will be converted as machine code and immediately added to the executable file. If we speak about DLLs, yes, you can reduce the output size, but you've got another issue. Loading in RT. I won't get any benefits.
Can you explain to me why?