The Power of JS Generators by Anjana Vakil

Поділитися
Вставка
  • Опубліковано 24 лис 2024

КОМЕНТАРІ • 188

  • @ilearnedtoday6014
    @ilearnedtoday6014 2 роки тому +165

    she is back

    • @tikendying
      @tikendying 2 роки тому +23

      Folks been waiting for her like a star wars trilogy

    • @Hunt92
      @Hunt92 2 роки тому +5

      Exactly my thought every time i see her in a video

    • @miloslazic3636
      @miloslazic3636 2 роки тому +1

      @@bradyfractal6653 She is just excited and happy to be presenting.

  • @EddyVinck
    @EddyVinck 2 роки тому +301

    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 2 роки тому +9

      same thing here bro she is amazing 🔥🔥

    • @kishanc8697
      @kishanc8697 2 роки тому +4

      Same here

    • @jacobyoung2045
      @jacobyoung2045 2 роки тому +5

      Yay! One more Anjana talk on the internet.

    • @2000mipo
      @2000mipo 2 роки тому +6

      THAT TALK WAS SO GOOD RIGHT?!

    • @carlospedroza2604
      @carlospedroza2604 2 роки тому +1

      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 2 роки тому +59

    I love her energy. Great presentation too! I've always struggled understanding generators.

  • @chhavimanichoubey9437
    @chhavimanichoubey9437 Рік тому +1

    I can't believe that this video helped me understand generators better than anything I ever saw or read on generators.

  • @khushalbhardwaj6192
    @khushalbhardwaj6192 2 роки тому +3

    just fascinated how can something that's so under talked and underrated small little thing can be this powerful and cool.

  • @phoneix24886
    @phoneix24886 2 роки тому +8

    Anjana is very energetic which makes the presentation interesting!

  • @dianyuanda3383
    @dianyuanda3383 2 роки тому +11

    I've never seen any speaker in a tech conference that talk so enthusiastic like her

  • @rishabhkalra9505
    @rishabhkalra9505 2 роки тому +13

    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.

  • @neonsamurai
    @neonsamurai 2 роки тому +20

    Very good intro. And yes you're totally right, generators are underused. Very much appreciate your talk!

  • @ZiedHF
    @ZiedHF Рік тому

    Love her energy, what a beautiful soul. Thanks for this wonderful presentation!

  • @rollandbryan9908
    @rollandbryan9908 2 роки тому +26

    Brilliant talk. Please keep the code being talked about on the screen!

    • @meljones2922
      @meljones2922 2 роки тому +3

      Yup! Here's the code/slides observablehq.com/@anjana/the-power-of-js-generators

  • @ShubhamKumar305
    @ShubhamKumar305 2 роки тому +2

    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.

  • @VKD007
    @VKD007 2 роки тому +2

    I studied generators few years ago but this explanation is so fun man

  • @stannone7272
    @stannone7272 2 роки тому +25

    start at 9:18

  • @hello2131991
    @hello2131991 2 роки тому +22

    Her energy is unmatched

  • @griof
    @griof 2 роки тому +3

    Another excellent talk. I'd recommend a talk she has about functional programming. She is a super good communicator!

  • @damians.7859
    @damians.7859 2 роки тому +100

    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...

    • @N32-e1g
      @N32-e1g 2 роки тому

      idk what are u talking about

    • @4ipon4ik
      @4ipon4ik 2 роки тому +6

      @@N32-e1g approx. 20:15 - 22:30 she explains her code step by step, but we don't see it because it's zoomed out.

    • @N32-e1g
      @N32-e1g 2 роки тому

      @@4ipon4ik anyway u can't learn js by watching conferences

    • @4ipon4ik
      @4ipon4ik 2 роки тому +12

      @@N32-e1g idk what are u talking about

  • @AnthonySherritt
    @AnthonySherritt 2 місяці тому

    Wow she's exceptional.Great job on this presentation!

  • @bmehder
    @bmehder 2 роки тому +4

    Anjana's talks are always bangers.

  • @pavelmikhadiuzk310
    @pavelmikhadiuzk310 2 роки тому +2

    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

  • @taz2392
    @taz2392 2 роки тому +3

    I have no idea what she’s talking about but it looks cool

  • @hyperrealhank
    @hyperrealhank 2 роки тому +2

    This could be among my favorite conference talks

  • @stevekyhon
    @stevekyhon 2 роки тому +3

    Watched from the beginning to the end. Good stuff!

  • @KresnaPermana
    @KresnaPermana 2 роки тому +1

    Finally the legendary is showing up

  • @oleanddro
    @oleanddro 2 роки тому

    Excellent presentation of GENERATORS! (who saw the introduction will understand)
    Great energy of Anjana Vakil! Thanks!

  • @lavendercode
    @lavendercode 2 роки тому +2

    Thank you for speaking in this video. I have never heard of generators but now I am curious. Thank you.

  • @shegsdev
    @shegsdev 2 роки тому +4

    Big fan of Anjana. Good to see her again.

  • @mahmoudaldawleh1982
    @mahmoudaldawleh1982 2 роки тому +2

    i love her energy😃

  • @user-dk5uv1xy5j
    @user-dk5uv1xy5j 2 роки тому +10

    We want more conf with her !

  • @phanCAbe
    @phanCAbe 2 роки тому +15

    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 2 роки тому

      thanks!

    • @anikets4699
      @anikets4699 2 роки тому

      😂🤣😅

    • @jincyquones
      @jincyquones 2 роки тому +1

      "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 Рік тому

      Bruh how is this too clever? It literally is explained in a 30 minute talk

    • @McQuinTrix
      @McQuinTrix Рік тому

      +1

  • @alex_chugaev
    @alex_chugaev 2 роки тому +1

    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.

  • @moosesnWoop
    @moosesnWoop 2 роки тому +1

    Great to see Anjana again, wow.

  • @zokizuan
    @zokizuan 2 роки тому

    Thanks Anjali for showering us with your...

  • @kevinrobertandrews
    @kevinrobertandrews 2 роки тому +2

    Taking from infinite sequences absolutely blew my mind! Thanks for sharing 😊

  • @ShripadaHebbar
    @ShripadaHebbar 5 місяців тому +1

    As always, her presentation is amazing!. One small observation: Actually the cardDeck, can be expressed in a purely functional way, as the generators returned by generator function are iterable as well as iterator:
    const cardDeck = function* () {
    const suits = ["♣", "♦", "♥", "♠"];
    const court = ["J", "Q", "K", "A"];
    for (let suit of suits) {
    for (let i = 2; i

  •  2 роки тому +2

    awesome Anjana Vakil, thanks for this masterclass

  • @rojonali3374
    @rojonali3374 2 роки тому +2

    Definitely she is amazing 😊

  • @michalkotlicki4710
    @michalkotlicki4710 2 роки тому +6

    She becomes more energetic every time she takes a sip of this "water".

  • @Thanadit231
    @Thanadit231 2 роки тому +4

    love her power

  • @qodesmith520
    @qodesmith520 2 роки тому +2

    At 2:38 she says "duck-duck-go'ing them..." #BOSS

  • @spiral5799
    @spiral5799 2 роки тому +2

    She is amazing, fun, smart, and beautiful

  • @Glibenko
    @Glibenko Рік тому

    I really appreciate your performance. Now I know more about generators and wanna apply them.😎

  • @rahulkanyal
    @rahulkanyal Рік тому

    Her energy and enthusiasm is mind-blowing.

  • @angelbates5672
    @angelbates5672 7 місяців тому

    Wow, this is such a great video. Thanks so much!

  • @mich_thedev
    @mich_thedev Рік тому

    One of the best speakers.

  • @iliyaskhan3803
    @iliyaskhan3803 2 роки тому

    Anjana knows the best way to engage all your senses

  • @amarwavare711
    @amarwavare711 2 роки тому

    She made generators quite simple to understand !

  • @code_react
    @code_react 2 роки тому +4

    No doubt its very useful but
    Why would you switch camera while she is explaining the code 20:15. :(

    • @alvarobyrne
      @alvarobyrne 2 роки тому

      yeah, producer was sleeping or editor mistake, or what?

  • @phytonprogrammer1998
    @phytonprogrammer1998 2 роки тому

    Happy to see you again 💜💜

  • @TheLexuguin
    @TheLexuguin 2 роки тому +3

    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.

  • @edgeeffect
    @edgeeffect 3 місяці тому +1

    Cool... I've seen some really stupid negative comments on some of her other talks but the Anjana fan club is out in force on this one... as it should be.

  • @ravierkonan1694
    @ravierkonan1694 2 роки тому

    Knew Anjana from her talk on Functional Programming. On her way to be the public voice of JavaScript.

  • @mdistiakhossain1035
    @mdistiakhossain1035 2 роки тому +6

    She is back again

  • @dmltdev
    @dmltdev 7 днів тому

    Great talk, thanks a lot!

  • @espectropolitico
    @espectropolitico 2 роки тому +4

    You're like an Marvel Superhero, but to JS. Trully saved me a day (again).

  • @thoril.pegason
    @thoril.pegason 5 місяців тому

    Wow this is very cool!

  • @samuellawrentz
    @samuellawrentz 2 роки тому +1

    Great talk! Love how generators can be used for various usecases. Also lowkey, I'm getting Zendaya vibes.

  • @sandro6103
    @sandro6103 2 роки тому +2

    She is fire 🔥

  • @sankaraishema5963
    @sankaraishema5963 Рік тому

    Awesome I finally understand ;)

  • @soltsdev
    @soltsdev 2 роки тому +1

    legend is back

  • @fabiovictorino350
    @fabiovictorino350 2 роки тому +3

    Good to see you.

  • @chhiringtamang7875
    @chhiringtamang7875 2 роки тому +2

    HOT NEW FEATURE FROM 6 YEARS AGO 🤣 BTW loved it.

  • @adittttya
    @adittttya 2 роки тому

    Amazing stuff! One of the best talks ever! 🙌

  • @vytenisurbonavicius9593
    @vytenisurbonavicius9593 Рік тому

    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...

  • @oleksandrvorovchenko8674
    @oleksandrvorovchenko8674 2 роки тому

    Great presentation! Thanks!

  • @Rollmops94
    @Rollmops94 2 роки тому

    I looked for this for ages

  • @AvanaVana
    @AvanaVana 2 роки тому

    I thought I understood generators. This blew my mind.

  • @hajiamano22
    @hajiamano22 2 роки тому +1

    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 2 роки тому

      Is it open source?

    • @hajiamano22
      @hajiamano22 2 роки тому

      @@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

  • @vladislavpeev5822
    @vladislavpeev5822 2 роки тому +1

    Quality content, but I needed to slow down the video speed a little :D

  • @xeoneraldo1254
    @xeoneraldo1254 2 роки тому +1

    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.

  • @limitless9483
    @limitless9483 Рік тому

    great talk btw you guys could have at least linked up the resources from the end of the video to your descriptiopn

  • @mohammedkaif1236
    @mohammedkaif1236 2 роки тому

    AWESOME

  • @prigithjoseph7018
    @prigithjoseph7018 2 роки тому

    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.

  • @mzubair10
    @mzubair10 2 роки тому

    I didn't realize generators were so powerful

  • @sudheerpoojary8975
    @sudheerpoojary8975 2 роки тому

    nice explanation

  • @sayeednazir8884
    @sayeednazir8884 2 роки тому

    wovvv ,,,,,, really amazing....!

  • @nitsanbh
    @nitsanbh 2 роки тому +5

    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

  • @SachinDolta
    @SachinDolta 2 роки тому

    Welcome back Anjana

  • @mknijnenberg85
    @mknijnenberg85 Рік тому

    What is the tool/website called where Anjana makes her code blocks with?

  • @mohammedkaif1236
    @mohammedkaif1236 2 роки тому

    awesome

  • @Rene-tu3fc
    @Rene-tu3fc 2 роки тому +1

    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.

  • @kishorrathva4097
    @kishorrathva4097 2 роки тому

    How does event loop handles it?

  • @savi_sandbox
    @savi_sandbox 2 роки тому

    is there a way to download the slides, presented in the video?

  • @Hoppi1001
    @Hoppi1001 2 роки тому +3

    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 2 роки тому

      observablehq.com/@anjana/the-power-of-js-generators

    • @omgd00d
      @omgd00d 2 роки тому

      observablehq.com/@anjana/the-power-of-js-generators

    • @anastasiiasolop6653
      @anastasiiasolop6653 2 роки тому

      the link was on the screen in the beginning observablehq.com/@anjana/the-power-of-js-generators

    • @rdil
      @rdil 2 роки тому +1

      The slideshow is linked at the beginning of the talk.

    • @user-df1gs1kf8w
      @user-df1gs1kf8w 2 роки тому

      Get a mac

  • @AlanSchooll
    @AlanSchooll 2 роки тому

    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.

  • @pahrurozi
    @pahrurozi 2 роки тому

    What is music intro?

  • @uubaidullah
    @uubaidullah 2 роки тому

    og is back ❤️

  • @misterl8129
    @misterl8129 10 місяців тому

    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

  • @SamruddhaShah
    @SamruddhaShah 2 роки тому

    Like your energy

  • @yoni532s9M5w
    @yoni532s9M5w 2 роки тому

    Why isn't js pressed about using generators for iteration like c# is? Isn't enumeration of entire arrays really bad in general?

  • @Tony-dp1rl
    @Tony-dp1rl 2 роки тому

    Makes you wonder why they can't get Tail Recursion into JavaScript compilers, if they can do this stuff :/

  • @ub-relax6800
    @ub-relax6800 Місяць тому

    I have a theory, that she herself is an asynchronous iterable generator, that consumes a lot of data, and some water, and then yields it for all of us, mere mortal, to try and get.

  • @MartinCharles
    @MartinCharles 2 роки тому

    generators are sick

  • @mehdi-vl5nn
    @mehdi-vl5nn Рік тому

    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.

  • @nhieljeff2156
    @nhieljeff2156 2 роки тому

    this is straight up sorcery

  • @SuperQuwertz
    @SuperQuwertz Рік тому

    21:30 I want to see the code...

  • @dc22199x
    @dc22199x 2 роки тому

    Looks similar to php's generator, but basically this is mostly borrowed concept of disappearing pointers.

  • @N32-e1g
    @N32-e1g 2 роки тому

    i'm not sure why do we need to use them

  • @pszznm
    @pszznm 2 роки тому +6

    I don't feel like this talk was particularly useful, as most of the examples could be done easily without generators. Especially the ping-pong was plain stupid as it weren't the generators that enabled to circumvent maximum call stack size, it was the queue + run function.... I really hoped to learn something good here...
    Anyway, to me, the only thing that makes generators worth it, is logic and I/O separation. It is something I needed to be able to write testable code that is heavily dependent on external factors like read/write, running external programs or communicating with them, etc... It is something I could not find any different reasonable solution for. There is nothing else I came to contact with for what I couldn't find simpler solution than generators.

  • @microcodes6887
    @microcodes6887 2 роки тому

    If you shows on the screen that's how it will execute then it will much better