Intro to Full Stack Development Frameworks and Libraries

Learning objective: By the end of this lesson, students will be able to distinguish between frameworks and libraries in software development, understand their roles and benefits, and recognize the differences between opinionated and unopinionated frameworks.

What are frameworks and libraries?

A library and a framework paired with their resulting applications

Frameworks and libraries are vital tools in software development. They leverage pre-written code to help accomplish common tasks without starting that work from scratch. While they both aid in development, they serve different purposes:

This analogy from freeCodeCamp outlines the difference:

A library is like browsing an Ikea catalog. You already have a home, but you need a bit of help with furniture. You don’t feel like making your own table from scratch. Ikea allows you to pick and choose different things to go in your home. You are in control.

A framework, on the other hand, is like building a model home. You have a set of blueprints and a few limited choices when it comes to architecture and design. Ultimately, the contractor and blueprint are in control. And they will let you know when and where you can provide your input.

Benefits of using frameworks and libraries

You can create full-stack applications without using frameworks or libraries, but this makes the process more complicated and time-consuming. It frequently involves developing features from scratch that are readily available in existing frameworks or libraries.

🧠 It’s important to note that libraries and frameworks are not programming languages themselves. They are built using languages like JavaScript, Python, etc.

They make a developer’s job easier by:

📚 Abstraction hides technical complexity and details irrelevant to solving a problem. It allows programmers to interact with complex systems at a simplified level without understanding the underlying information.

Types of frameworks

There are many different types of frameworks, but they can be broadly categorized into two groups: opinionated and unopinionated.

Opinionated

Opinionated frameworks encourage or enforce a particular way of doing things as dictated by the framework. Put another way, they prefer conventions over configuration. There are a few advantages to this approach.

Unopinionated

Unopinionated frameworks are the opposite of opinionated frameworks, allowing developers more freedom in their projects. Since these frameworks are the inverse of opinionated, they prefer configuration over convention. Once again, there are a few benefits to this approach:

Trade-offs

So which are better, unopinionated or opinionated frameworks? There’s no straightforward answer to this because each exists to solve different kinds of problems, and the benefits of each come with trade-offs.

For example, when using an opinionated framework, developers must learn and follow a rigid structure given by the framework. This makes the learning curve steeper but comes with the trade-off that code written by different developers with the same framework will be more consistent. Similarly, unopinionated frameworks allow for more customization, but that means more decisions have to be made, which can slow down meaningful development.

Luckily, as a junior developer, it’s unlikely you will make decisions about which of these to use to build applications in an organization, but beginning to understand the nuances between frameworks/libraries and opinionated/unopinionated frameworks will help you develop a deeper understanding of the differences between different tech stacks.