DEV Community

Amanu
Amanu

Posted on

2 3

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.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up