I have some familiarity with C++, and concepts like compiling and linking static and dynamic libraries, which is what I understand as collections of code that simplify doing certain things.

But then I get confused in certain cases, for example, why is OpenGL considered an API? Why is it necessary to use other libraries like GLAD, freeGLUT or GLFW to interface with OpenGL?

And then other languages have this thing called package managers, like pip, node, cargo, and vcpkg for c/c++, where you install these packages that get used like libraries? What’s the difference?

Finally the ones I understand the least of are frameworks. I keep hearing the concept of frameworks like Angular for js and a lot of stuff that’s too alien for me because I’m still unfamiliar with web development.

So for example, I’m using the raylib library for a small game project I have. I link the .lib or .dll file to my executable file so I know I’m unambiguously using a library. How come there’s also Cocos2dx which is a framework? What’s the distinction?

  • artificialfish
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 day ago

    RE: The biggest problem about this is the API definition. Libraries have APIs. But in a completely different way, webservers have APIs. If I say “we are going to a conference on API’s” what do you hear? That we are going to talk about REST, GraphQL, or gRPC, or web server APIs of some type. This is common phraseology. However, one time I was invited to such a conference, and it ended up being about C# design philosophy.

    In that way API is an adjective (REST API, C# API, …) AND a noun (webserver API). That’s a problem.

    And as an adverb, there is some justification to replace it with Library and others (REST Endpoint, C# Library)

    Because otherwise all public functions are API’s, which doesn’t seem necessary to me. Saying a Library has an API is somewhat redundant. Saying a server hosts an API is not, many servers run jobs or databases. Many websites don’t host APIs. Etc.