Is there still a difference between a library and an API?

后端 未结 8 1646
清歌不尽
清歌不尽 2021-01-29 20:07

Whenever I ask people about the difference between an API and a library, I get different opinions. Some give this kind of definition, saying that an API is a spec and a library

8条回答
  •  隐瞒了意图╮
    2021-01-29 20:22

    I think that Library is a set of all classes and functions that can be used from our code to do our task easily. But the library can contain some of its private functions for its usage which it does not want to expose.

    API is a part of library which is exposed to the user. So whatever documentation we have regarding a library, we call it an API Documentation because it contains only those classes and functions to which we have access.

提交回复
热议问题