DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Amanu
Amanu

Posted on

Library vs Frameworks: My own two cents

About a week ago, I was reading a brilliant blog titled β€œAnyway, this is why I prefer Vue over React”.

He called Vue a library, to which I commented on otherwise. And it sparked an argument that lasted with β€œlet’s agree to disagree”.

Here is what I think

Vue is a framework.

In my opinion, the main distinction between framework and library is who calls who. And callbacks doesn’t count.

Frameworks impose a structure the client must follow in order to make it work. They depend upon the structure you implement to manage the life-cycle of activities. Vue does just that. Let me explain why

When you define a Vue component, you define some methods and objects.

new Vue({
  data: () => {
    return: {}
  },
  computed: {},
  mounted: () => {
  }, 
  watch: {
  }
})

If this was java or any other real object-oriented system, you would have been extending some base class or implementing an interface. Annotating your methods or sometimes just following some naming rules(like Vue). Then the framework decides to call what and when.

When you use a library, you will not be implementing any structure or API, you’ll be calling the API on the library.

Top comments (0)

Want to Create an Account?
Now it's your turn!
Β 
πŸ—’ Share a tutorial
πŸ€” Reflect on your coding journey
❓ Ask a question

Create an account to join hundreds of thousands of DEV members on their journey.