+ 4

Difference between a framework and library?

In many of the programming languages I have tried, all of them have libraries and frameworks. What's the difference between the two? I think I have a small idea but I'm not positive. Thanks in advance! :)

23rd Mar 2017, 7:18 PM
Thomas John
Thomas John - avatar
3 Answers
+ 4
the difference lies in the flow of control. we , i.e., our code CALLS library methods but on the other hand in framework our code is being called by the framework. Take JavaScript and php example : when we do document.ready(){ function xyz (){ //code } } here 1st line is framework since it is calling our code and second line is somewhat library's method since we or our code is calling some method. I tried to keep things as simple as possible, hope it helps.
23rd Mar 2017, 8:10 PM
Nikhil Kumar
Nikhil Kumar - avatar
+ 3
Thanks 😃
23rd Mar 2017, 8:10 PM
Thomas John
Thomas John - avatar