"I saw a job post the other day. It required 4+ years of experience in FastAPI. I couldn't apply as I only have 1.5+ years of experience since I created that thing. " - Sebastián Ramírez 😁
What does the GIL has to do with Async Await? Async Await run on an event loop. This always happens on a single CPU. Async Await are asyncronos operations for tasks with low computational load and the majority of the task's time is taken by simply waiting for a response. For example like a HTTP call. You make a call, and then you just sit and wait for a reply. And if it takes a long time, everything is stuck because your code is executing one line at a time. With async await you can say "While I wait for the HTTP call to give me a response, other operations can proceed running" and this is why async calls don't block the thread. This has nothing to do with working on multiple CPUs.
So many frameworks built on top of each of these many languages that you could not decide which to use I might just go with no framework at all so I could have a peaceful life.
It's not that difficult really. If you know exactly what the app needs to do, what is your current experience is and/or what are you willing to learn, answers will become pretty obvious. Why choose python over php for example? It's generally a bit easier, there are ton's of algorithmic libraries for things like image processing, robotics, deeplearning etc. This will mostly lead you to Django, Flask or FastAPI. Django is overkill for small project, so your left with Flask vs FastAPI. This is over simplified but you get the deal.
GIL does not matter, since node/express are single threaded either way, and you seem to compare them somewhat. One would not use a python / js backend framework for CPU-bounded work that one wants to parallelize, you would use Scala, Java, C# or even C++.
@@TheMr82k not sure what you mean, but the distinction of CPU vs. IO bound (not bounded, my mistake in the first post) is a simple rule to know if you need something more powerful than PHP / JS / Ruby / Python. It get's 80% there, doesn't it?
Asynchronous is the future, at least for the most part. The event loop is far easier to understand and manage than multi-threading. Indeed there are specific tasks best suited for multiple threading but still in most cases the async/await is more than enough and some alternatives like service workers or isolates in dart can compensate.
Uhmm how is async even related to concurrency in anyway as async happens on the same thread ( i am coming from a nodejs world so maybe its different in python).
Async has everything to do with concurrency, as it allows for multiple tasks to start, run and complete at overlapping time periods (while one is waiting for an external process or service to complete, others can be running). As you point out, that doesn't mean that any two of them will ever run simultaneously, that would be parallelism. In node it's the same thing, you have threads (parallelism) and you also have async/await (concurrency). The key is to know when to use each one. For web servers what you'll want is concurrency most of the time, as most of the time you'll be waiting for databases and other web services and API's to complete, during that time you can start processing other requests. Edit: Seems like Node is characteristically single threaded, so you're probably doing mostly async stuff with it anyways ;)
@@tianlechen There's almost no reason to ever write a web service in Python unless you're forced to. It's probably the area where it does worst. It's painful without static typing for non trivial projects
@Yassin Zao Well at my work we use C# all the time, so that tends to be the defacto web server language. Though on my side projects, I tend to just use Rust. Been meaning to play with Elixir though.
If you wanna learn one first I would recommend start with flask after one day decide you want to continue or move to Django Don’t start with fastAPI If you learned flask pretty much fastAPI is the same and learning it is easy
Thankss for this. Just a small thing, I started with DRF and I find django to be really awesome. The only problem is that it handles so much on it's own, that I feel like I am not understanding how things work. When I go to the docs, there is so so so much inheritance, that it is confusing as hell. If I shift to some other framework in the future, would it be troublesome, since dango handles so much on its own. If you can tell me something, it will be really helpful.
I can say asyncio is to me very complicated. The GIL does limit most applications however it can be done but it is very tricky IMO. This FastAPI seems very impressive.
I disagree, For ANY type of project it is always helpful if the framework's core has a light footprint so that development focus can stay on the app. I Also disagre with the intepertation that "flask is for basic apps", It is a lean framework where one may need to tiein extras if needed. fastapi maybe new but evauating it as a backend framework, it gives the developer a lot more to work with!
@@realchrishawkes I looked into it a little bit more. Channels does have support for doing async http, but it's not really intended for that. channels.readthedocs.io/en/stable/topics/consumers.html#asynchttpconsumer
I would say if you need no to little interactivity django + the built in template engine is fine, else you could still use django + vuejs or alpine as a CDN like you'd do with jquery ( never tried react that way so I can't tell ), still with django's template engine. If you need an API + separated frontend yes DRF + React/Vue is the way to go, it involves a steeper learning curve and you'd have to think about things that were "just working" with vanilla django like authentication, but it also gives advantages ( excellent npm libraries ) and flexibility, seems to be the way to go nowadays
Just here to to support your work, found your channel through ( Bucky video ).I am from commerce background just guide me with the first thing I have to learn bcz their is not anything for where to start like competitive coding, projects, language, oops, data structures and algo .. Just give me first path so that I can make my own way🙏 Which language can I learn first c or c++ or both
async frameworks are a big deal when building microservices. the current is turning towards those. but async support isn't there yet in many languages, so what to do? i found that from all things async nodejs is the easiest one to use. java has webflux, but i only had trouble with that. i think all of golang's http frameworks use goroutines which is go's way of doing async, so that's a good choice also. so either nodejs or go. all other things will just give you trouble
@@realchrishawkes certainly because nodejs is more used nowadays and some people just swear by what is trendy instead of focusing on trying to find the right tool for the job, thus they focus on some premature optimization that aren't even relevant if you don't have reddit's trafic and do poor jobs for what really matters for their particular project. I'm sure Django + DRF is more than relevant for 95/100 of websites out here.
@@hasibuzzamantonmoy8845 that question is still fair. i am here to see if python made some kind of big break thru and appreantly it just made small improvements.
If the business logic is the most important part of your project, python is easier to start with. I acknowledge c# and .Net core might be just as good, and give better performance, but I know python much better so i stick witj it
"I saw a job post the other day. It required 4+ years of experience in FastAPI. I couldn't apply as I only have 1.5+ years of experience since I created that thing. "
- Sebastián Ramírez 😁
😀😀😀😀
Kkkkkk
These job requirements are too stupid.
😂
4+ years of experience on 3 +years old technology.
Hopefully Django will pick up some of the good stuff from this because I'm still more comfortable making complicated tasks with it.
What does the GIL has to do with Async Await? Async Await run on an event loop. This always happens on a single CPU. Async Await are asyncronos operations for tasks with low computational load and the majority of the task's time is taken by simply waiting for a response. For example like a HTTP call. You make a call, and then you just sit and wait for a reply. And if it takes a long time, everything is stuck because your code is executing one line at a time. With async await you can say "While I wait for the HTTP call to give me a response, other operations can proceed running" and this is why async calls don't block the thread. This has nothing to do with working on multiple CPUs.
🔥 If you're learning to code, check out my website 👉 codehawke.com/all_access.html 🔥
Learn more 👉 ruclips.net/video/fpp215OSRV0/видео.html
Nice interesting that you didn't jump into the difference between those 3 directly in speed and talk about async side.
Thanks for watching and commenting!
So many frameworks built on top of each of these many languages that you could not decide which to use I might just go with no framework at all so I could have a peaceful life.
It's not that difficult really. If you know exactly what the app needs to do, what is your current experience is and/or what are you willing to learn, answers will become pretty obvious. Why choose python over php for example? It's generally a bit easier, there are ton's of algorithmic libraries for things like image processing, robotics, deeplearning etc. This will mostly lead you to Django, Flask or FastAPI. Django is overkill for small project, so your left with Flask vs FastAPI. This is over simplified but you get the deal.
GIL does not matter, since node/express are single threaded either way, and you seem to compare them somewhat. One would not use a python / js backend framework for CPU-bounded work that one wants to parallelize, you would use Scala, Java, C# or even C++.
True.
CPU bounded work is a big over simplification.
@@TheMr82k not sure what you mean, but the distinction of CPU vs. IO bound (not bounded, my mistake in the first post) is a simple rule to know if you need something more powerful than PHP / JS / Ruby / Python. It get's 80% there, doesn't it?
Fastapi
Is the best python API solution
Asynchronous is the future, at least for the most part. The event loop is far easier to understand and manage than multi-threading. Indeed there are specific tasks best suited for multiple threading but still in most cases the async/await is more than enough and some alternatives like service workers or isolates in dart can compensate.
Asynchronous is not the future. It's already here.
This video is exactly what I was looking for!
Thank you for sharing.
I will definitely try FastAPI for new projects.
Because of your flask series im trying to create mafia movie-tvshows review site THANK YOU !!!
As of this writing Flask 2.0 provides support for async/await.
Sorry if this is too meta, but do you have a course or resource on building a course site? I would love to build a course site for myself in Django.
FastAPI > Flask > Other Python web frameworks > Django
Uhmm how is async even related to concurrency in anyway as async happens on the same thread ( i am coming from a nodejs world so maybe its different in python).
Async has everything to do with concurrency, as it allows for multiple tasks to start, run and complete at overlapping time periods (while one is waiting for an external process or service to complete, others can be running). As you point out, that doesn't mean that any two of them will ever run simultaneously, that would be parallelism. In node it's the same thing, you have threads (parallelism) and you also have async/await (concurrency). The key is to know when to use each one. For web servers what you'll want is concurrency most of the time, as most of the time you'll be waiting for databases and other web services and API's to complete, during that time you can start processing other requests.
Edit: Seems like Node is characteristically single threaded, so you're probably doing mostly async stuff with it anyways ;)
Great video! I like Flask, but I think FastAPI very interesting...
Thank you!
The only time I ever set up a web API in Python is when I have an ML model that needs endpoints.
Why else lmao
@@tianlechen There's almost no reason to ever write a web service in Python unless you're forced to. It's probably the area where it does worst. It's painful without static typing for non trivial projects
@Yassin Zao Well at my work we use C# all the time, so that tends to be the defacto web server language. Though on my side projects, I tend to just use Rust. Been meaning to play with Elixir though.
@@Rosenzweigjcb following your logic it is better to write in C++ than in Assembly. Just waste of time and money.
Thank you! this video helped
No problem.
If you wanna learn one first I would recommend start with flask after one day decide you want to continue or move to Django
Don’t start with fastAPI
If you learned flask pretty much fastAPI is the same and learning it is easy
And for Async I will use java if I really care about speed and it’s the de facto /deal breaker I will use rust
Thankss for this. Just a small thing, I started with DRF and I find django to be really awesome. The only problem is that it handles so much on it's own, that I feel like I am not understanding how things work. When I go to the docs, there is so so so much inheritance, that it is confusing as hell. If I shift to some other framework in the future, would it be troublesome, since dango handles so much on its own. If you can tell me something, it will be really helpful.
Off-topic: May I know the font you are using. Thanks.
thanks brother, it was a very good video
Thank you!
Any new gui frameworks for python you recommend checking out?
Dart for me
I can say asyncio is to me very complicated. The GIL does limit most applications however it can be done but it is very tricky IMO. This FastAPI seems very impressive.
Just do it
wtf python is actually fast now?
Hi Chris, very interesting, do you have any thoughts on Django Channels ? Cheers
Teacher thanksnfor this. Can you make some djangorestframework advice?
I disagree, For ANY type of project it is always helpful if the framework's core has a light footprint so that development focus can stay on the app. I Also disagre with the intepertation that "flask is for basic apps", It is a lean framework where one may need to tiein extras if needed. fastapi maybe new but evauating it as a backend framework, it gives the developer a lot more to work with!
What about Django Channels?
Good question. github.com/django/channels/issues/1416
I don't think its there yet, as in fully async.
@@realchrishawkes I looked into it a little bit more. Channels does have support for doing async http, but it's not really intended for that.
channels.readthedocs.io/en/stable/topics/consumers.html#asynchttpconsumer
I will try it...
I too like nest js because it's awesome...
Great 👍
Why didn't you use C# as your web backend for your website?
This video is about Python's frameworks......
Thoughts on something like DRF and react or just coding a site in django in 2021?
I would say if you need no to little interactivity django + the built in template engine is fine, else you could still use django + vuejs or alpine as a CDN like you'd do with jquery ( never tried react that way so I can't tell ), still with django's template engine. If you need an API + separated frontend yes DRF + React/Vue is the way to go, it involves a steeper learning curve and you'd have to think about things that were "just working" with vanilla django like authentication, but it also gives advantages ( excellent npm libraries ) and flexibility, seems to be the way to go nowadays
Just here to to support your work, found your channel through ( Bucky video ).I am from commerce background just guide me with the first thing I have to learn bcz their is not anything for where to start like competitive coding, projects, language, oops, data structures and algo ..
Just give me first path so that I can make my own way🙏
Which language can I learn first c or c++ or both
Hey I am also doing commerce for grad (from India), and had the same confusions. I also fell in love with coding. Maybe we can have a talk.
How do you know all these things!! Damn!
async frameworks are a big deal when building microservices. the current is turning towards those. but async support isn't there yet in many languages, so what to do? i found that from all things async nodejs is the easiest one to use. java has webflux, but i only had trouble with that. i think all of golang's http frameworks use goroutines which is go's way of doing async, so that's a good choice also. so either nodejs or go. all other things will just give you trouble
whatup chris!!!!!!
Not much, how are you?
To me i think fastapi is better though its new i have worked with both Django and Fastapi its ... why fastapi is so flexible
And win knex😉
Please make a tutorial on fastapi
And don't forget fronted.
Content is too good to have a misleading title like that
Check out HUG for small projects
When developers talk about which framework is better, just escape!! Not worth your your time.
Yeah it's clickbait.
"Django is ranked 354, FastApi is way faster at rank 270".. Definitely a typical web developer chit chat when logic is on a vacation.
Thanks for sharing.
Thank you. I realized python is bad language. People choose nodejs
I don't think it's a bad language, but it's bad for certain jobs. Some jobs it's great at. Why do you think it's a bad language?
@@realchrishawkes certainly because nodejs is more used nowadays and some people just swear by what is trendy instead of focusing on trying to find the right tool for the job, thus they focus on some premature optimization that aren't even relevant if you don't have reddit's trafic and do poor jobs for what really matters for their particular project. I'm sure Django + DRF is more than relevant for 95/100 of websites out here.
Noob
Correct answer: none of them
okay, Mr Edge
Why would someone use Python for web development instead of Node.JS or languages like C# and Java with (IMHO) much better performance?
🙄
What are you even doing here then? Lol.
@@hasibuzzamantonmoy8845 that question is still fair. i am here to see if python made some kind of big break thru and appreantly it just made small improvements.
If the business logic is the most important part of your project, python is easier to start with. I acknowledge c# and .Net core might be just as good, and give better performance, but I know python much better so i stick witj it
Because it's more readable and way less of a pain in the ass when dealing with databases and other systems programming situations...