What is a Framework?

  Рет қаралды 32,954

Red Black Tech

Red Black Tech

Күн бұрын

What is a [software] framework actually?
In our quest to take down popular tech buzzwords, we're going to tackle frameworks next.
A software framework is a bring-your-own-code system that takes your code and runs it through its own complex code that achieves some task.
For example take a look at your operating system (OS). it's a large program that has code for creating files, running processes, and more.
On top of that, you can extend your OS by creating more files and subprocesses to do whatever you'd like.
In this example, the OS provides users a hook into itself. such hooks are a telltale sign of a framework. in general a hook is something that the framework expects YOU, the coder, to fill in. the framework will then take your "thing" and integrate it into itself at some point.
Depending on what specific framework you're dealing with, you will of course have different constraints on what your hook looks like.
For example in the web development framework Next.js, you can create new pages in your site by creating a new file in the `./pages` directory. in this case the pages directory is your hook into the nextjs html generating framework.
In Next.js, you're expected to export a single function as the default function for that file that will later be imported by the nextjs engine.
So a framework is some system that lets you hook into it. this sort of hooking, more formally known as inversion of control, is what differentiates using a library from using a framework.
A great example of inversion of control is taking the train to work versus taking your own car. with your own car, YOU move IT, but with the public transport framework, you're expected to bring yourself to it so IT moves YOU.
#nodejs
#expressjs
#reactjs
#webdevelopment
#softwareengineering
#django
#flask
#fastapi

Пікірлер: 23
@Phat_trick910
@Phat_trick910 5 ай бұрын
For newbies in programming, Framework is for Scripting language - which is usually used for Web Developing, not Kernel, Game Developing.
@redblacktech
@redblacktech 5 ай бұрын
agreed. framework is indeed commonly used in the context of web dev like you say, and through this video I'm hoping to break that unnecessary coupling of ideas.
@JEsterCW
@JEsterCW Жыл бұрын
XD i still have no idea
@redblacktech
@redblacktech Жыл бұрын
Its really any system that has hooks into it. Think of going to work using an urban train system as opposed to using your car. Driving your own car is like writing your own program. The train system lets you hook into it by being at a specific place at a specific time (train station) - this makes taking the train like writing on top of a framework.
@iCloutOrg.-uy4rs
@iCloutOrg.-uy4rs 8 ай бұрын
​@@redblacktechdamn..... that's a good analogy
@redblacktech
@redblacktech 8 ай бұрын
Ha - I didn't come up with the analogy, but it's a great one
@JustinLietz
@JustinLietz 6 ай бұрын
⁠​⁠​⁠@@redblacktechso isn’t a programming language a framework then? I don’t understand the difference between a language and a framework
@redblacktech
@redblacktech 6 ай бұрын
yes. i'd claim a language is a framework for writing programs easily, and let's you hook into itself through functions, classes, and all the other things you're used to with a language. i believe you will not like that answer, so let me put it in the way that most people mean when they say framework. when you use a CODE framework, you're installing a library like React where there's a looot of code written already. what's special about this code is that IT BECOMES THE MAIN CODE of your program, and all you're doing is making that code more specific to solve your specific problem. for example React will provide you a component tree, and will worry about rendering that tree on your browser (roughly speaking). all you need to do is add more components to that tree.
@zakzak24
@zakzak24 Жыл бұрын
does a module fall under a framework or is it interchangeable with a library? e.g : Python modules
@redblacktech
@redblacktech Жыл бұрын
good question. modules are unrelated to frameworks; modules mostly exist as a mechanism for breaking up code into multiple files. it has a precise definition in a given language eg Python module. as for the relation between framework and module: there's no real relation, but sometimes a framework will actually let you "hook" into itself by creating your own module (search "Hugo modules") a library is a (usually big) collection of code. usually frameworks are packaged in a library, and there are many modules in the library. I suggest doing more of your own research about frameworks and libraries; this is only my best answer.
@subinkv6849
@subinkv6849 4 ай бұрын
React is actually a library
@redblacktech
@redblacktech 4 ай бұрын
can you explain what makes you say that? i'm curious because someone else has said the same thing, but that seems incorrect. theres inversion of control going on in react - another giant piece of code is running the code you provide.
@2ch921
@2ch921 3 ай бұрын
thanks
@redblacktech
@redblacktech 3 ай бұрын
you're welcome
@delta_shankar
@delta_shankar Жыл бұрын
How to change the frame work to pay charm to python
@redblacktech
@redblacktech Жыл бұрын
i dont fully follow, you can type your question in your native language and youtube will translate it. pycharm is not a framework, its a fancy tool for letting you write code. you can write python without it
@stevencoy
@stevencoy Жыл бұрын
Isn't React a library and not a framework?
@redblacktech
@redblacktech Жыл бұрын
That's a tough question. Even though React doesn't explicitly call itself a framework I'd argue it is. React claims it's not opinionated (as frameworks usually are) however it provides mechanisms like hooks and a component tree that you're supposed to extend. Perhaps I'm wrong but in my opinion having to define components in a component tree is no different from having to define files in a filesystem tree. Pair the component tree with the inversion or control that occurs when using features like hooks or lifecycle methods and you've got yourself a framework. Feel free to push back on what I'm saying, these concepts are all blurry since they're usually used interchangeably.
@stevencoy
@stevencoy Жыл бұрын
@@redblacktech React technically is a library and not a framework, but is often referred to colloquially as a framework and compared side-by-side to other frameworks like Angular, Vue, and Next. It's not exactly apples to oranges, maybe more like apples to apple pie. Also, React is more like a framework when used with CRA or other toolchains. Perhaps most importantly, employers seem to refer to React commonly as a framework on job listings. So, pointing out that React is a library is kind of like pointing out that a tomato is a fruit... technically right but not always necessary. Either way, it is definitely confusing for newcomers.
@redblacktech
@redblacktech Жыл бұрын
Well then I guess this definition I proposed for a framework isn't perfect because it includes React. Though I can't seem to find a more clear definition of framework. If you have any references let me know.
@yisus__mt09
@yisus__mt09 11 ай бұрын
Speak slower bro
@redblacktech
@redblacktech 11 ай бұрын
its kinda hard to do that in youtube shorts since it enforces 60s (as opposed to tiktok which actually lets you run longer) but i'll keep that in mind
What are libraries and frameworks?
12:59
Codecademy
Рет қаралды 108 М.
How to OVER Engineer a Website // What is a Tech Stack?
11:20
Fireship
Рет қаралды 2,3 МЛН
Amazing weight loss transformation !! 😱😱
00:24
Tibo InShape
Рет қаралды 58 МЛН
How to Roll Your Own Auth
13:05
Ben Awad
Рет қаралды 52 М.
The TRUTH About Golang Backend Frameworks
6:31
Melkey
Рет қаралды 107 М.
What is the difference between frameworks and libraries?
8:58
Java Brains
Рет қаралды 129 М.
What is a JavaScript Framework? (in detail)
8:06
SuperSimpleDev
Рет қаралды 215 М.
How to Think Fast Before You Speak: Framework Thinking
9:24
Vicky Zhao [BEEAMP]
Рет қаралды 1,6 МЛН
Python or JavaScript - Which One Should YOU Learn?
8:05
Tech With Tim
Рет қаралды 171 М.
The Story of Next.js
12:13
uidotdev
Рет қаралды 557 М.
What Are APIs? - Simply Explained
6:49
Simply Explained
Рет қаралды 875 М.
Don't throw exceptions in C#. Do this instead
18:13
Nick Chapsas
Рет қаралды 254 М.
JavaScript: How It's Made
10:54
Fireship
Рет қаралды 874 М.