A programming library is a file that provides routines
A programming library is a file that provides routines , data, and data types that can be used from the program's source code. Using libraries is a way to reuse the same code.
Choosing the right programming library can make it easier to complete almost any task. Writing programs using only pure programming language elements takes a lot of time, and sometimes even impossible.
Categorization Due to the time the library was added to the program, we distinguish between static libraries added during consolidation and dynamic libraries added during program startup.
Static libraries Main article: Static library . Static libraries (called. Static library) are linked to the program during consolidation (linking). In the case of tools provided by Microsoft for Windows systems, library files are usually .obj .lib or .obj , whereas for packages in Unix family systems (e.g. GCC ) and their ports for Microsoft system (e.g. MinGW )
Dynamic libraries Application Programming Interface An Application programming interface (API) has been defined to standardize work with the software development library. This allows the library user to focus on what the library offers, rather than how it is implemented on different platforms.
The API is designed as a standard for communication between applications and library functions. The creators of software interfaces (for example, Microsoft) emphasize that they should be easy to use, unambiguous, and well documented. In the lifecycle of a programming library, the interface is the most permanent element, and the consequences of each change must be carefully analyzed. Individual libraries may have multiple implementations, but adhere to a standard interface structure (for example, the definition of the "C standard library", which is just an API definition, rather than one specific library).
Thanks to a well-defined API, you can replace one library with another without having to change the application. An example of this is the libjpeg library, whose API was used to implement the much faster libjpeg-turbo library. As a result, libjpeg-turbo replaced libjpeg in many projects using the JPG format, including in browsers and graphics programs, and became the default JPG support library in new Linux and other Unix-like distributions.
Libraries are very often implemented using a single source programming language. Interfaces (APIs) for other languages are created using so-called bindings - this is an implementation of this programming library in another language. The main code of the software libraries is implemented in the most computationally efficient programming language. The other languages define only the interface level (API) specific to a given language, including mechanisms that allow you to use library features from another programming language. The C language is a popular language in which the main part of the library is written, because of the speed and simplicity of writing wrappers from C to other languages.
The available libraries may be written using a programming style or programming paradigm that does not match those in your environment or operating system. In order not to force programmers into an unnatural programming style and at the same time allow the use of a programming library, libraries with similar functionality are created, but with a rewritten interface in accordance with the rules and principles of the target environment. To do this, the so-called shells are code fragments that accept a call in the language of a given program, convert them into a library language call, send the call to the library, and process the returned results in a language-appropriate form.
History The creators of the library concept are Maurice Wilkes, David J. Wheeler and Stanley Gill, authors of the book "Preparing programs for an electronic digital Computer" in 1951 1xbet รหัสโปรโมชั่น