Libraries and Frameworks

Libraries and Frameworks

What's the meaning and what are the differences??

I'm sure you've heard the word framework and libraries before and I'm very sure that majority of developers don't even know the real definition of these words.

Defintion of Framework and Library

Framework

A framework, or software framework, is a platform for developing software applications. It provides a foundation on which software developers can build programs for a specific platform. Or in simpler terms, a framework is a tool which allows to develop software and create systems. A framework is similar to an application programming interface (API). As the name suggests, a framework serves as a foundation for programming, while an API provides access to the elements supported by the framework. To explain further, Picture a coffee making machine and your coffee, milk, sugar or the ingredients you use in making your coffee as your code. The machine knows how to make a coffee. It compiles your code which is your coffee ingredients and it knows when to add milk and the powder and everything needed. The only thing you need do is to put your ingredients in the right place to get your coffee

Library

A library is a collection of pre compiled routines that a program can use. It is designed to assist both the programmer and the programming language compiler in building and executing software.

So what are the differences?

Back to the example of a coffee machine, a library is like an utensil in your kitchen, it's you who decides whatever utensil you want to use. You decide when to put your milk, or your sugar. You have the control and you decide the output yourself.

A library can be good for you or a framework. Both have advantages and disadvantages.

framework.JPG

Conclusion

Saying a framework is better than a library or vice versa is not a better conclusion. Because you have to use the use functions and not the tool itself. Each solution has its pros and cons. But if you want to achieve a good result, try combining the two tools together.

Use and write libraries for each small thing your project does, like a ‘shop’, ‘search engine’ or maybe a ‘file management’, create proxy packages for them and use those packages in your favorite framework.

This way you will get good code quality, speed, reusability and control (advantages of libraries), as well as faster programming, and support from the community (advantages of frameworks).

Did you find this article valuable?

Support Bode's blog by becoming a sponsor. Any amount is appreciated!