From the course: Programming Foundations: Beyond the Fundamentals

Understanding libraries and frameworks - Python Tutorial

From the course: Programming Foundations: Beyond the Fundamentals

Understanding libraries and frameworks

- All the different types of external code available for programmers can be overwhelming but getting the difference between libraries and frameworks can be especially challenging. Both are larger collections of software tools that help developers accomplish specific tasks. But while a library gives you a set of tools that you can use as you wish, like this cake mix and frosting, a framework essentially defines how you should accomplish a task, like this completed cake where the shape, size, and frosting color are already set, leaving just the personalization to me. When you decide to use a framework, some decisions are already made for you. As long as you understand how to code within the framework, it can save you time. But if you're not ready to commit to a specific approach for the app you're building or if there's no framework that meets the needs of what you're creating, then you can decide on your own approach to coding it up and use one or more libraries as tools to help you get it done. In Python, popular libraries include TensorFlow and pandas for machine learning tasks, and NumPy and SciPy for mathematical manipulations. Widely used Python frameworks include Django and Flask, which are both used for web content management. Other modern programming languages have a wide variety of both libraries and frameworks available as well. In JavaScript, for instance, the Lodash library offers some general programming utilities. While the jQuery library provides tools for selecting and working with webpage elements. Widely used JavaScript frameworks for building web apps include React, Angular, and Vue. When you're starting out with programming, the programs you write often don't need libraries or frameworks. I started out coding in JavaScript, and for a while, I got along just fine not using any of those. I built out basic webpages for friends and simple apps, like a date picker and countdown clock, with nothing but basic JavaScript, and they worked great. So when you're just starting out, you won't necessarily need to dig into libraries or frameworks right away, but down the road, you might. So file this away. As you take on larger scale programming challenges, check out the libraries and frameworks available in whatever language you've chosen and see what they can do for you. They might be helpful.

Contents