The Power of JS Generators by Anjana Vakil

  Рет қаралды 159,411

JSConf

JSConf

Жыл бұрын

Generators have been around in JavaScript since ES2015, yet remain largely ignored by many JS devs, who don’t see why or how they’d use them in their day-to-day work. But generators - which we can think of as special functions whose execution can be “paused” and resumed later on - are actually extremely powerful tools for producing and consuming series of data. That makes them perfect for implementing lazy sequences, custom iterables, animation, even the convenient asynchronous programming we now enjoy with “await”! In this talk we’ll dive into how JS generators work, what makes them so powerful, and why you should care.
jsconfbp.com/speakers/anjana-...
About Anjana:
Anjana suffers from a chronic case of curiosity, which led her from philosophy to English teaching to computational linguistics to software development. These days she mostly codes & teaches from her home base in San Francisco, but she’ll always be a traveler at heart. Nerd out with her about functional programming & JavaScript, ask her about the Recurse Center & Outreachy, and definitely invite her to your karaoke party!

Пікірлер: 182
@ilearnedtoday6014
@ilearnedtoday6014 Жыл бұрын
she is back
@tikendying
@tikendying Жыл бұрын
Folks been waiting for her like a star wars trilogy
@Hunt92
@Hunt92 Жыл бұрын
Exactly my thought every time i see her in a video
@miloslazic3636
@miloslazic3636 Жыл бұрын
@@bradyfractal6653 She is just excited and happy to be presenting.
@EddyVinck
@EddyVinck Жыл бұрын
I knew I recognised her from the Functional Programming talk I saw years ago! It's one of the first talks I ever saw and it drove me to learn more JS! Go Anjana!
@mohammedsalah4954
@mohammedsalah4954 Жыл бұрын
same thing here bro she is amazing 🔥🔥
@kishanc8697
@kishanc8697 Жыл бұрын
Same here
@jacobyoung2045
@jacobyoung2045 Жыл бұрын
Yay! One more Anjana talk on the internet.
@2000mipo
@2000mipo Жыл бұрын
THAT TALK WAS SO GOOD RIGHT?!
@carlospedroza2604
@carlospedroza2604 Жыл бұрын
She has given several awesome talks, and you can find multiple of them here in youtube! Search for her name, the subjects she covers are varied.
@Play_Streams
@Play_Streams Жыл бұрын
I love her energy. Great presentation too! I've always struggled understanding generators.
@samuelmorkbednarzkepler
@samuelmorkbednarzkepler 11 ай бұрын
Bro got that Einstein e=mc2 rizz 👀
@neonsamurai
@neonsamurai Жыл бұрын
Very good intro. And yes you're totally right, generators are underused. Very much appreciate your talk!
@damians.7859
@damians.7859 Жыл бұрын
Such a nice talk, it's a shame that the person that editted it made a lot of cuts when code was presented and instead showed audience from the back...
@user-vj3cu3wv9l
@user-vj3cu3wv9l Жыл бұрын
idk what are u talking about
@4ipon4ik
@4ipon4ik Жыл бұрын
@@user-vj3cu3wv9l approx. 20:15 - 22:30 she explains her code step by step, but we don't see it because it's zoomed out.
@user-vj3cu3wv9l
@user-vj3cu3wv9l Жыл бұрын
@@4ipon4ik anyway u can't learn js by watching conferences
@4ipon4ik
@4ipon4ik Жыл бұрын
@@user-vj3cu3wv9l idk what are u talking about
@rishabhkalra9505
@rishabhkalra9505 Жыл бұрын
Finally we have a great explanation to generators. I knew about these for quite some time but since they are not much used, had limited knowledge on how to make them work with complex things, especially async ones. Great session.
@griof
@griof Жыл бұрын
Another excellent talk. I'd recommend a talk she has about functional programming. She is a super good communicator!
@stannone7272
@stannone7272 Жыл бұрын
start at 9:18
@ShubhamKumar305
@ShubhamKumar305 Жыл бұрын
I've read about the iterators and iterables from MDN and since then I was like, now I know what can be iterated on JS and how. And when I read about generators I was like, yeah they are there, but how to effectively use them. Thank you Anjana for showing us the various ways.
@alex_chugaev
@alex_chugaev Жыл бұрын
It was so exciting it ended in a blink of an eye. Thanks Anjana, generators have big potential. I’m gonna experiment with them, doing state manager and renderer.
@phoneix24886
@phoneix24886 Жыл бұрын
Anjana is very energetic which makes the presentation interesting!
@dianyuanda3383
@dianyuanda3383 Жыл бұрын
I've never seen any speaker in a tech conference that talk so enthusiastic like her
@khushalbhardwaj6192
@khushalbhardwaj6192 Жыл бұрын
just fascinated how can something that's so under talked and underrated small little thing can be this powerful and cool.
@oleanddro
@oleanddro Жыл бұрын
Excellent presentation of GENERATORS! (who saw the introduction will understand) Great energy of Anjana Vakil! Thanks!
@adittttya
@adittttya Жыл бұрын
Amazing stuff! One of the best talks ever! 🙌
@stevekyhon
@stevekyhon Жыл бұрын
Watched from the beginning to the end. Good stuff!
@VKD007
@VKD007 Жыл бұрын
I studied generators few years ago but this explanation is so fun man
@hello2131991
@hello2131991 Жыл бұрын
Her energy is unmatched
Жыл бұрын
awesome Anjana Vakil, thanks for this masterclass
@rollandbryan9908
@rollandbryan9908 Жыл бұрын
Brilliant talk. Please keep the code being talked about on the screen!
@meljones2922
@meljones2922 Жыл бұрын
Yup! Here's the code/slides observablehq.com/@anjana/the-power-of-js-generators
@bmehder
@bmehder Жыл бұрын
Anjana's talks are always bangers.
@orangeprogrammer
@orangeprogrammer Жыл бұрын
Thank you for speaking in this video. I have never heard of generators but now I am curious. Thank you.
@chhavimanichoubey9437
@chhavimanichoubey9437 Жыл бұрын
I can't believe that this video helped me understand generators better than anything I ever saw or read on generators.
@ZiedHF
@ZiedHF 11 ай бұрын
Love her energy, what a beautiful soul. Thanks for this wonderful presentation!
@kevinrobertandrews
@kevinrobertandrews Жыл бұрын
Taking from infinite sequences absolutely blew my mind! Thanks for sharing 😊
@mahmoudaldawleh1982
@mahmoudaldawleh1982 Жыл бұрын
i love her energy😃
@hyperrealhank
@hyperrealhank Жыл бұрын
This could be among my favorite conference talks
@shegsdev
@shegsdev Жыл бұрын
Big fan of Anjana. Good to see her again.
@Thanadit231
@Thanadit231 Жыл бұрын
love her power
@angelbates5672
@angelbates5672 Ай бұрын
Wow, this is such a great video. Thanks so much!
@rojonali3374
@rojonali3374 Жыл бұрын
Definitely she is amazing 😊
@user-dk5uv1xy5j
@user-dk5uv1xy5j Жыл бұрын
We want more conf with her !
@Glibenko
@Glibenko Жыл бұрын
I really appreciate your performance. Now I know more about generators and wanna apply them.😎
@zokizuan
@zokizuan Жыл бұрын
Thanks Anjali for showering us with your...
@oleksandrvorovchenko8674
@oleksandrvorovchenko8674 Жыл бұрын
Great presentation! Thanks!
@typescript_evangelist
@typescript_evangelist Жыл бұрын
One of the best speakers.
@moosesnWoop
@moosesnWoop Жыл бұрын
Great to see Anjana again, wow.
@phanCAbe
@phanCAbe Жыл бұрын
This is a great talk! However I always think back to the JS platform docs at my second job (at a very large company).... " Generators: Don't use generators." And it still makes sense because no matter what you do you'll always end up with code that's "too clever".
@schobihh2703
@schobihh2703 Жыл бұрын
thanks!
@anikets4699
@anikets4699 Жыл бұрын
😂🤣😅
@jincyquones
@jincyquones Жыл бұрын
"too clever" a.k.a. requires prerequisite knowledge of how they work, which most devs lack because they're too scared to use them
@RamkrishanYT
@RamkrishanYT 9 ай бұрын
Bruh how is this too clever? It literally is explained in a 30 minute talk
@McQuinTrix
@McQuinTrix 8 ай бұрын
+1
@taz2392
@taz2392 Жыл бұрын
I have no idea what she’s talking about but it looks cool
@phytonprogrammer1998
@phytonprogrammer1998 Жыл бұрын
Happy to see you again 💜💜
@code_react
@code_react Жыл бұрын
No doubt its very useful but Why would you switch camera while she is explaining the code 20:15. :(
@alvarobyrne
@alvarobyrne Жыл бұрын
yeah, producer was sleeping or editor mistake, or what?
@pavelmikhadiuzk310
@pavelmikhadiuzk310 Жыл бұрын
she is crazy)) and Is it contagious) It spreads) I even see how I shout "Generators!" in the middle of night while I am sleeping
@TheLexuguin
@TheLexuguin Жыл бұрын
You've been using them without even knowing it. Async/Await are basically syntactic sugar for generators. Before them, to achieve a similar functionality, you had to use generators.
@sayeednazir8884
@sayeednazir8884 Жыл бұрын
wovvv ,,,,,, really amazing....!
@amarwavare711
@amarwavare711 Жыл бұрын
She made generators quite simple to understand !
@soltsdev
@soltsdev Жыл бұрын
legend is back
@KresnaPermana
@KresnaPermana Жыл бұрын
Finally the legendary is showing up
@Rollmops94
@Rollmops94 Жыл бұрын
I looked for this for ages
@savi_sandbox
@savi_sandbox Жыл бұрын
is there a way to download the slides, presented in the video?
@sankaraishema5963
@sankaraishema5963 Жыл бұрын
Awesome I finally understand ;)
@sandro6103
@sandro6103 Жыл бұрын
She is fire 🔥
@mohammedkaif1236
@mohammedkaif1236 Жыл бұрын
AWESOME
@Hoppi1001
@Hoppi1001 Жыл бұрын
Would it be possible to get those code snippets from somewhere? Yes, I can copy from the screen but maybe I can save some typing if it is.
@soumen_pradhan
@soumen_pradhan Жыл бұрын
observablehq.com/@anjana/the-power-of-js-generators
@omgd00d
@omgd00d Жыл бұрын
observablehq.com/@anjana/the-power-of-js-generators
@anastasiiasolop6653
@anastasiiasolop6653 Жыл бұрын
the link was on the screen in the beginning observablehq.com/@anjana/the-power-of-js-generators
@rdil
@rdil Жыл бұрын
The slideshow is linked at the beginning of the talk.
@user-df1gs1kf8w
@user-df1gs1kf8w Жыл бұрын
Get a mac
@spiral5799
@spiral5799 Жыл бұрын
She is amazing, fun, smart, and beautiful
@mknijnenberg85
@mknijnenberg85 Жыл бұрын
What is the tool/website called where Anjana makes her code blocks with?
@sudheerpoojary8975
@sudheerpoojary8975 Жыл бұрын
nice explanation
@kishorrathva4097
@kishorrathva4097 Жыл бұрын
How does event loop handles it?
@misterl8129
@misterl8129 3 ай бұрын
Anyone make the Starwars example work? I cant. How it is working? How i can console.log the object starwars with all the data? Thanks
@vladislavpeev5822
@vladislavpeev5822 Жыл бұрын
Quality content, but I needed to slow down the video speed a little :D
@xeoneraldo1254
@xeoneraldo1254 Жыл бұрын
Really cool technology, great to finally have it in JS. We already have that in C# for years, its nothing new. I wonder when will source generators come for JS.
@AvanaVana
@AvanaVana Жыл бұрын
I thought I understood generators. This blew my mind.
@vytenisurbonavicius9593
@vytenisurbonavicius9593 7 ай бұрын
Great presentation and great energy! Regarding generators - it might be just me but it still feels to me like generators are a cool yet much less readable way to do stuff. Yield makes code run in a non-linear and less intuitive fashion. I wonder if it is just me...
@michalkotlicki4710
@michalkotlicki4710 Жыл бұрын
She becomes more energetic every time she takes a sip of this "water".
@prigithjoseph7018
@prigithjoseph7018 Жыл бұрын
Still need to be explain, what is the easiest way of implementing data science and Machine learning with js, and to more often a offline ide for such purpose.
@ravierkonan1694
@ravierkonan1694 Жыл бұрын
Knew Anjana from her talk on Functional Programming. On her way to be the public voice of JavaScript.
@uubaidullah
@uubaidullah Жыл бұрын
og is back ❤️
@SachinDolta
@SachinDolta Жыл бұрын
Welcome back Anjana
@qodesmith520
@qodesmith520 Жыл бұрын
At 2:38 she says "duck-duck-go'ing them..." #BOSS
@mohammedkaif1236
@mohammedkaif1236 Жыл бұрын
awesome
@Rene-tu3fc
@Rene-tu3fc Жыл бұрын
not sure if python stole from js or the other way around, but they seem to look and function identically. very fun to use, but easy to create unreasonable code imo.
@limitless9483
@limitless9483 Жыл бұрын
great talk btw you guys could have at least linked up the resources from the end of the video to your descriptiopn
@pahrurozi
@pahrurozi Жыл бұрын
What is music intro?
@espectropolitico
@espectropolitico Жыл бұрын
You're like an Marvel Superhero, but to JS. Trully saved me a day (again).
@iliyaskhan3803
@iliyaskhan3803 Жыл бұрын
Anjana knows the best way to engage all your senses
@samuellawrentz
@samuellawrentz Жыл бұрын
Great talk! Love how generators can be used for various usecases. Also lowkey, I'm getting Zendaya vibes.
@softwarelivre2389
@softwarelivre2389 Жыл бұрын
What is Zendaya? Now I'm curious
@farhanbajwa4954
@farhanbajwa4954 Жыл бұрын
So one of the most important things generator does is that you cannot store an infinite amount of data on your memory like calculating factorials, or stream of data through api it look something like pagination only bring that part of data, when it actually needed.
@SamruddhaShah
@SamruddhaShah Жыл бұрын
Like your energy
@yoni532s9M5w
@yoni532s9M5w Жыл бұрын
Why isn't js pressed about using generators for iteration like c# is? Isn't enumeration of entire arrays really bad in general?
@fabiovictorino350
@fabiovictorino350 Жыл бұрын
Good to see you.
@mdistiakhossain1035
@mdistiakhossain1035 Жыл бұрын
She is back again
@hajiamano22
@hajiamano22 Жыл бұрын
Generators are so underutilized. I created a javascript framework with them that let's me build web apps in 1/10th of the time it took me before.
@Ty-13
@Ty-13 Жыл бұрын
Is it open source?
@hajiamano22
@hajiamano22 Жыл бұрын
@@Ty-13 Not currently, and there are a lot of reasons for that. One there are a lot of better frameworks out there more suited for speed that people should consider like solidjs. My framework is different. It doesn't have custom components, just pre-built components that all fit together in a grid system. The cool thing is getting data from the user happens synchronously. So you don't need to have call back functions for forms. When it's on the screen the program yields and waits for the form to be submitted before continuing execution
@stacksagar
@stacksagar Жыл бұрын
❤️❤️🔥
@amansaxena4827
@amansaxena4827 Жыл бұрын
👍
@rahulkanyal
@rahulkanyal Жыл бұрын
Her energy and enthusiasm is mind-blowing.
@nitsanbh
@nitsanbh Жыл бұрын
Good code is clear, not tricky. Implementing a bidirectional channel using a proper object would be so much more readable (and customizable) than using generators’ .next tricks
@chhiringtamang7875
@chhiringtamang7875 Жыл бұрын
HOT NEW FEATURE FROM 6 YEARS AGO 🤣 BTW loved it.
@mzubair10
@mzubair10 Жыл бұрын
I didn't realize generators were so powerful
@nhieljeff2156
@nhieljeff2156 Жыл бұрын
this is straight up sorcery
@officialrajdeepsingh
@officialrajdeepsingh Жыл бұрын
wooo
@SuperQuwertz
@SuperQuwertz 6 ай бұрын
21:30 I want to see the code...
@user-vj3cu3wv9l
@user-vj3cu3wv9l Жыл бұрын
i'm not sure why do we need to use them
@dc22199x
@dc22199x Жыл бұрын
Looks similar to php's generator, but basically this is mostly borrowed concept of disappearing pointers.
@Tony-dp1rl
@Tony-dp1rl Жыл бұрын
Makes you wonder why they can't get Tail Recursion into JavaScript compilers, if they can do this stuff :/
@ihatethesensors
@ihatethesensors Жыл бұрын
I'm watching this right now with the console open. Haha!
@MartinCharles
@MartinCharles Жыл бұрын
generators are sick
@microcodes6887
@microcodes6887 Жыл бұрын
If you shows on the screen that's how it will execute then it will much better
@farhanbajwa4954
@farhanbajwa4954 Жыл бұрын
I learned generators in python and it looks the same in javascript.
@workout.trending
@workout.trending Жыл бұрын
can anyone tell me how to learn javascript as fast as possible
@mikoaj1954
@mikoaj1954 Жыл бұрын
don't fixate on learning as quickly as possible, this is wrong approach. Just write your own code, bc that's the only way to get better at solving problems with help of programming language of ur choice.
@madcalm2024
@madcalm2024 Жыл бұрын
Only in practice on complex projects with many real-life featutes.
@workout.trending
@workout.trending Жыл бұрын
@@mikoaj1954 true thanks man
@mehdi-vl5nn
@mehdi-vl5nn 10 ай бұрын
The problem with those who lack computer education is exactly this. The order is actually like this: Stackless coroutines, event loops, self-suspending functions, iterators, simpler syntax generators, coroutines with simpler syntax, async functions, tasks, promises or futures. But wait, my dear friends. Promises in JavaScript have nothing to do with promises in reality. They are actually a function that puts itself in a queue! JavaScript's foolish features insult the spirit of programming and computer science.
@henrikrinne3639
@henrikrinne3639 Жыл бұрын
I like her
Async Generators - Javascript In Depth
38:33
Tech with Nader
Рет қаралды 2,1 М.
Object Oriented Programming is not what I thought - Talk by Anjana Vakil
38:51
ISSEI funny story😂😂😂Strange World | Pink with inoCat
00:36
ISSEI / いっせい
Рет қаралды 28 МЛН
skibidi toilet 73 (part 2)
04:15
DaFuq!?Boom!
Рет қаралды 32 МЛН
КИРПИЧ ОБ ГОЛОВУ #shorts
00:24
Паша Осадчий
Рет қаралды 6 МЛН
Self Taught Coders Don't Exist | Anjana Vakil | The Secret Sauce
32:47
How to use Generator Functions in JavaScript - Tutorial
18:47
Python or JavaScript - Which One Should YOU Learn?
8:05
Tech With Tim
Рет қаралды 133 М.
Using async generators to stream data in JavaScript
27:37
Fun Fun Function
Рет қаралды 34 М.
Vanilla JavaScript Projects with Anjana Vakil | Preview
9:28
Frontend Masters
Рет қаралды 5 М.
FASTEST Way To Learn Coding and ACTUALLY Get A Job
10:44
Brian Cache
Рет қаралды 865 М.
Эффект Карбонаро и бумажный телефон
1:01
История одного вокалиста
Рет қаралды 1,9 МЛН
Обманет ли МЕНЯ компьютерный мастер?
20:48
Харчевников
Рет қаралды 125 М.
How about that uh?😎 #sneakers #airpods
0:13
Side Sphere
Рет қаралды 9 МЛН