In software, what’s the difference between a Framework, a Library, an Environment etc?

395 viewsOtherTechnology

I understand what a language is, stuff like Python, Java, Javascript, Swift etc. And I understand what an IDE is, it’s basically an advanced text editor tailored to helping you with writing code.

But I’m lost after that. I’ve heard that react is a framework? Is that because it’s kind of an add-on to JavaScript? If so, how is that different to a package or a Library? Or is a framework a type of library? Where do things like Spring, or Gradle or Flutter fit into this as well? Until recently, I thought Flutter was a language, but now I’m learning that the language might be Dart?

I’ve finished a full degree in Computer Science, and have been in Software Development for over a year now, but this has become no less clear to me.

In: Technology

10 Answers

Anonymous 0 Comments

A general difference between a library and a framework seems to be “your code calls library code; framework code calls your code”. React is called a framework, because you are supposed to write component classes/functions, which would then be called by the framework, when the user navigates to a certain URL.

That being said, frameworks usually contain a lot of functions and classes that you call/instantiate from your code and most coders will call the whole thing “a framework”.

Anonymous 0 Comments

A library is external code you can use

A framework is basically an over controlling library, the framework has a specific way it wants you to do something, and if you dont do it exactly that way, you are going to have a bad time

What exactly constitutes a unique language is anyone’s guess. For me, it is a language if the interpreter/compiler can handle the user code without an addon, so typescript is a language because JS throws syntax errors trying to read the code, what flutter exactly is is anyone’s guess but they claim to be a framework, so thats enough for me.

An environment however is very different. The environment is how your computer (or where you are running the code) is setup. exactly which version of which library did you have installed? any special paths/files? how about “environment variables” managed by the calling program?

Anonymous 0 Comments

Library is like a coffee machine – it has some functions you can use whenever you feel like it. Make me a coffee, make me a latte, give me hot water etc.
You press a button and you get an expected result. You do not know necessarily what is going on inside.

Framework is a kitchen – it contains tools and appliances you need to cook.

You need to make a coffee by hand? No problem, framework has a pan and a stove ready for you. You need to provide coffee and water though as a developer.

You need something to transfer your coffee from the container into the pan? No problem, framework’s got a spoon for you. You still gotta stir it.

Need to measure how much coffee you need? No problem, framework’s got a small scale for you. You still gotta decide what the measurement results mean for you.

Anonymous 0 Comments

A library is a well tested, optimized or otherwise superior piece of code that your program runs to perform limited actions. For example you might want to use a library to render text, because you don’t care about the myriad of intricacies relating to font files and optimized rendering, but you still want nice crisp text in your application.

A framework is a complete set of interconnected libraries that sort of “takes over” your program, and your program is simply sitting on top of it and driving it. An example would be Qt. It has functions for everything in a modern GUI, rendering of GUI widgets, handling of input methods, management of multiple screens, showing of file dialogues, printing, showing webpages etc. The list goes on and on. You don’y need to use Qt as a framework since you can just use the features you like as a library, but it is very convenient. Qt is also cross platform so you know your program will work without changes to your code on many platforms.

An environment is basically a running instance of an OS. Each program is launched inside an environment. The environment holds variables that the program can read to figure out how it is supposed to run.

Anonymous 0 Comments

Imagine you are building a sandcastle in a sandbox. A library is like a set of special tools and molds you can use to build different parts of your sandcastle. You can pick up any tool you need, like a shovel, a bucket, or a mold for making walls, and use it whenever you want.

A framework is like a pre-built structure for your sandcastle that gives you a basic shape to start with. It has spaces where you can add towers, walls, and decorations. You have to follow the rules of the framework to build your castle, but it helps you by giving you a strong starting point and some guidance on how to build it.

An environment is like the entire playground where your sandbox is. It includes the sandbox, the tools, the framework, and everything else you need to build your sandcastle. It makes sure you have a safe and fun place to play, with all the things you need in one spot.

Anonymous 0 Comments

A library is like a toolbox. It sits next to your program and provides you with the tools you need.

A framework is like driving an excavator: you get inside it and operate it the way it tells you to, but you chose it in the first place because it does what you need to do. 

An environment is just that, everything surrounding the program. This can mean the operating system, the editor/IDE you’re using, compiler/interpreter, etc.

Anonymous 0 Comments

Since you have a degree, I’ll step it up to ELI16 at least.

A library provides a bunch of functionality in the form of functions. For example, the String library in C++ allows you to write strings instead of just arrays of chars. So the library gave you the datatype “string” and comes with a bunch of functions and attributes involving that string.

A framework builds upon the idea of a library and is basically “a new way of developing/thinking.” Instead of just handling strings, why don’t we (the creators of the library) just handle the input/output of strings as well, maybe even conversion of strings. Maybe they can just create entire huge datastrictures to render a string in a graphical way.
Maybe we can just handle the networking to send this graphics to someone. Maybe we have such a huge package of stuff that we can send you an install file because we have 5000 packaged files used in different locations.

The line between framework and library isn’t always clear, and it’s mainly when you’re not thinking in the native programming language anymore, but you’re thinking in the language of the framework. Different people will have different opinions regarding if something is a library or framework.

An environment is a specific configuration of external settings, aka the way your computer is set up to allow you to work. If you work in IT, the IT support group will most likely have configured your environment for you to some degree. This can include installing software (IDE), adding your account to access groups, etc.

Certain software and frameworks will require specific configuration and libraries and linkers to function. These software/frameworks can come with their own environment, called a runtime environment, which makes sure the correct computer state is set when launching the software and restored after the software finishes.

Sometimes, certain projects require different environments, for example, if you have different versions of a framework. For example, you’re in a project running a certain version of an installed framework, using a certain configuration, but you want to make another project on the side, using a new version of the framework.

Now, we can use a third party software to keep track of the different configurations. We can just download both versions of the framework, and the virtual environment manager points the computer to different versions of the framework. When we “activate” an environment, you tell the software to tell the computer to use a certain configuration.

Sometimes, it’s not enough to keep track of what versions of certain frameworks and libraries we’re using, and we might need an entire copy of the configuration for the OS. At these times, we can use something like docker (third party software) to create images/copies of the entire computer configuration.

Docker images are used when you want to guarantee that everyone is developing against the same computer configuration but provides a bit of computational overhead in exchange.

Anonymous 0 Comments

An environment is just the software installed on a machine and any settings/configurations (e.g. the files in /etc/hosts). You can also have virtual environments with tools like containers or python virtual environment to have mutliple environments on the same machine.

As far as library vs framework, the definition I would use is that if its something you see often on resumes/job descriptions and people put stickers of the logo on their laptops, then its a framework, otherwise its a library.

Anonymous 0 Comments

A lot of things are in the name itself

Library- a place where you go to look things up in books. Similarly, you can use libraries in your code to look up already written lines of code.

Framework- a structure for any construction. Similarly you can follow this structure to write your code. The good thing about following a common blueprint is that a lot of the parts are already pre-made that can be reused.

Environment- a place where things exist and supports in growth of things within. In code there are a lot of environments and sub environments.
Some support writing your code, some support reading your code, some support running your code. Each is specifically designed for the type of work you want to do.

If you’re going to code in Java script you can write all the code yourself in .js files using your integrated development environment IDE to write code, and then you can use the javascript engine and Javascript runtime environment to run your code. These parts make your code functional, some pre-made libraries are used here used to perform the most basic functionalities.

You can code in this way, but if you do this, you are going to be rewriting functionality that everyone needs and probably has. To consolidate this, some smart people wrote common code into libraries. They formed a good structure for how to organize your code. Then they released a framework called reactJS which leverages those libraries and rules for following that format.

If you use this framework, you are going to follow a common standard for writing code, which is fine because you want to follow a common convention for consistency and understandability. And it lets you use those common libraries to make your work easier.

Anonymous 0 Comments

Library: You’re a carpenter, and the library is your toolbox. You’re doing ALL of the work yourself, but occasionally you need the help of a hammer or screwdriver from your toolbox.

Framework: You’ve hired a carpenter. He’s doing ALL of the work himself. Occasionally he asks your opinion about what size windows you want, etc… but otherwise he’s doing all the work and you’re just waiting around to answer his questions only when he asks.