What is a monad? (Design Pattern)

Поділитися
Вставка
  • Опубліковано 25 чер 2022
  • Programming often relies on combining functions in data pipelines. The monad is a design pattern which makes pipelines with effect much easier to write and maintain.
    Monads are often explained using haskell in complicated ways but I tried here to simply explain the pattern with javascript to build an intuition of them.
  • Наука та технологія

КОМЕНТАРІ • 887

  • @AByteofCode
    @AByteofCode  2 роки тому +451

    Hiya! It turns out that what is described in this video is the Functor and not the Monad. The difference between these two is quite minor so I'll leave it here.
    A monad is just a functor which has some extra property within the bind method. Functions being passed in bind calls must have as their return types an instance of the monad being used. The bind method of a monad would then need to "unwrap" that value.

    • @wanderingthewastes6159
      @wanderingthewastes6159 2 роки тому +16

      Wait, so I’m using a monad everytime I call .unwrap() in Rust?

    • @AByteofCode
      @AByteofCode  2 роки тому +32

      ​@@wanderingthewastes6159 I would need to look into it but from the little I know, unwrap is a method of an Option type, which I believe is a monad. You would need to ask someone who knows more about rust than me, I've only seen like 2-3 No Boilerplate videos.

    • @felixnderitu1455
      @felixnderitu1455 2 роки тому +21

      Hey can you do a full Video about Design patterns ?

    • @mskiptr
      @mskiptr 2 роки тому +24

      No, no, no! What you described here *are* properties of a typical _monad_ (barring some technicalities).
      _Functors_ are things you can write a _map_ function for, such as _lists_ (applies the function to every element inside), but also _maybe_ (apply the function if there is something inside).

    • @nxone9903
      @nxone9903 2 роки тому +48

      a monad is just a monoid in the category of endofunctors

  • @andrasfogarasi5014
    @andrasfogarasi5014 2 роки тому +1094

    A monad is just a monoid in the category of endofunctors. I don't know what people don't get about that.

    • @AByteofCode
      @AByteofCode  2 роки тому +134

      Hehe... Just wait a few weeks and I'll have a full video about that sentence (and all the CT necessary to understand it)

    • @oscareriksson9414
      @oscareriksson9414 2 роки тому +40

      Yes. That is thing I understand.. endofunkting easy! 😁

    • @Brunoenribeiro
      @Brunoenribeiro Рік тому +64

      "bart, say the line!"

    • @AByteofCode
      @AByteofCode  Рік тому +10

      @@Brunoenribeiro im tempted to ask stemg for his permission to use that clip in a video lmao

    • @arsnakehert
      @arsnakehert Рік тому +3

      @@AByteofCode Subscribed to wait for it lol

  • @crabbyboi9127
    @crabbyboi9127 Рік тому +543

    I'm a big fan of the "fireship style" of videos and it's great to see more people creating high quality content like this

    • @AByteofCode
      @AByteofCode  Рік тому +86

      It's about time the style leaves web development and talks about other stuff :)

    • @yt-1337
      @yt-1337 Рік тому +7

      @@AByteofCode exactly

    • @4xmo
      @4xmo Рік тому +2

      why is that in quotes lol

    • @dailyfunnytv358
      @dailyfunnytv358 Рік тому +2

      @@4xmo because he's not the creator

    • @Yazan_Majdalawi
      @Yazan_Majdalawi 9 місяців тому +1

      This channel is much better at this "style" than fireship, this one is much clearer, fireship's vids are a mess

  • @falkelh
    @falkelh Рік тому +60

    I already know what a monad is: it's that thing that my annoying friend who's just learned Haskell won't stop talking about

  • @tylerscott9277
    @tylerscott9277 Рік тому +64

    This 2 minute video is a better explanation of monads than some hour long lecture I've watched. Really good stuff!

    • @AByteofCode
      @AByteofCode  Рік тому +2

      Thanks for the kind words! Honestly those lectures are good but too long to focus on so they end up not being good. Lectures are also generally performed in front of a group of students with assumed knowledge basics. I wrote this video with no pre-requisites other than knowing a tiny bit of programming.

  • @samuelwaller4924
    @samuelwaller4924 2 роки тому +462

    You may be very small now, but with this quality of content you will definitely be big one day!

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

      Thanks for the kind words and optimism!

    • @9paradox
      @9paradox 2 роки тому +7

      i approve this comment.

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

      I approve this sentiment. The video content is high quality already and I support such efforts much. I can't wait to see what is next from "A Byte of Code", especially as a hobby programmer interested much in both past and future tech advances.

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

      @@hydralisk98 Ever heard of JSF*ck? :p

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

      @@AByteofCode You mean the JS implementation of Brainf*ck? Not the JS edition before this video but yes I am aware of it. I do am aware of much as far as my curiosity lead me to, both in esoteric prog langs and more serious ones like Common Lisp, C# and even exploring F#/F*. Hopefully as I dive into the history of web tech (going before even SGML & IBM's GML), we may collaborate on advanced programming functional structures soon. ^*^//

  • @tsyf1
    @tsyf1 2 роки тому +143

    Fireship's influence shows. You're also just as talented at explaining complex things in a short time.

    • @AByteofCode
      @AByteofCode  Рік тому +42

      I started this channel in part to further the Fireship style to other realms of programming, so that is actually a great compliment, thank you!

    • @DavidSimonTetruashvili
      @DavidSimonTetruashvili Рік тому +5

      And it's a great style. Imitating it, I think, will only bring good things as it mutates through creators picking it up.
      Also, refreshing to see this style without the usual inside jokes fireship includes in his fast-pace videos which can sometimes be misconstrued as facts...

    • @AByteofCode
      @AByteofCode  Рік тому +6

      @@DavidSimonTetruashvili I agree fireship has an amazing way of showcasing content and that its a good place to start out from and develop one's own style off of it. Was expecting to have more time to adapt but youtube's algorithm did not agree. I watch a lot of fireship but can't think of any of these inside jokes off the top of my head, would you have an example or two by any chance?

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

      @@DavidSimonTetruashvili I was thinking the same thing. It'll be very interesting watching this style evolve.

    • @miquelvazquez4544
      @miquelvazquez4544 Рік тому +3

      @@AByteofCode he usually uses irony! stuff along the lines (off the top of my head, not exact quote) of: "we all love getting a new framework every month"

  • @AByteofCode
    @AByteofCode  2 роки тому +10

    What can I do to make my future videos better? Any feedback (even negative) is much appreciated!

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

      remember to pin your comments so i can see then at the top :)

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

      @@briandublidi4708 oh right yeah lol ty for pointing that out

  • @gilmoretj
    @gilmoretj 8 місяців тому +39

    This has to be the best explanation of Monads I have found out of all the many, many, many videos I have watched, and definitely the most productive 2 minutes and 30 second - highly recommended.
    I suspect one of the major difficulties with explaining the concept are the different mindsets of the audience from the instructor. The vast majority of instructors will be from a declarative/Functional Programming background where solutions are defined in terms of what needs to be done. The audience will largely comprise developers from an imperative OOP/Procedural background where solutions are formed by defining the steps required to resolve the problem.
    Having an explanation in terms of how the monad resolves a problem by absorbing some of the steps is really easy to understand. The last 60 seconds of this video really hits that message home, but I would not go as far as to suggest watching the video in reverse.

    • @AByteofCode
      @AByteofCode  8 місяців тому +4

      Thank you!! The second paragraph is definitively key to what made this video work. When I made it, my understanding of functional programming was pretty mediocre, making it no more than an imperative programmer trying to explain monads to other imperative programmers. However I never actually realized what I had done until this comment, so thanks for pointing it out :)

    • @mrdkaaa
      @mrdkaaa 6 місяців тому

      Not only it doesn't solve the presented problem, it's NOT a monad at all. Your lengthy comment is just silly.

  • @swankitydankity297
    @swankitydankity297 2 роки тому +82

    I commend you for having so clearly and accessibly explained a notoriously difficult topic. I finally feel like I actually understand what these are now. Thanks!

  • @polycode2688
    @polycode2688 2 роки тому +61

    These videos are well made, keep making them!

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

      Glad you like them, I definitively will continue!

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

    To the point, concise and clear explanation. Just what a developer needs.

  • @robinmoussu
    @robinmoussu Рік тому +8

    That’s probably the best concise explanation of monad I’ve read so far!

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

    Great video±! You have enlightened my vision on computer science by finally explaining to me what a monad is dude.

  • @DanielRamBeats
    @DanielRamBeats Рік тому +3

    There have been many attempts to explain monads and many have failed but your example makes it extremely clear, thank you

  • @charleshughes1417
    @charleshughes1417 Рік тому +2

    This is the most comprehensible explanation of monads I've come across. Thanks.

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

      That is very nice to hear :) You're welcome!

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

    The best Monad explanation I've seen so far.

  • @uselessDev
    @uselessDev 29 днів тому +1

    Most clear and concise explanation of monads that I've seen - amazing stuff

  • @txzk26
    @txzk26 6 місяців тому

    This is the most clear and intuitive explanation of monad I ever had. Thanks

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

    Whoa, sifted through a lot of Haskell literature and was none the wiser. Thanks for the succinct explanation.

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

    The best explanation I've seen so far, yet by far the shortest too. Great work!

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

    Best explaining Monad ever.

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

    Finally understood why I would want a monad

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

    You are an excellent instructor. I will stick with you.

  • @leshommesdupilly
    @leshommesdupilly 8 місяців тому +3

    Wow, that was a very clear explanation !
    Now I know how useful monads are.
    Unfortunately, I already forgot what they are.

  • @3_14pie
    @3_14pie Місяць тому

    After watching this video again after months and others of countless explanations + category theory, I think I'm finally beginning to get it

  • @nomoredarts8918
    @nomoredarts8918 11 місяців тому

    In 2 minutes you explain concept that everyone else can't explain in 20 minutes or more!

  • @ElliottParkinson
    @ElliottParkinson Рік тому +2

    Insane quality of content for a channel so small. You've earned my subscription

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

      Thank you! I'm glad you enjoyed this video that was uploaded to a 30 sub channel :)

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

    Thank you. I still don't understand monads, but this is the very first video which gives me hope that I might understand monads one day.

  • @RamiGB
    @RamiGB Рік тому +6

    Being a functor or a monad doesn't matter you've done a brilliant video in a beautiful way that would hopefully inspire newer developers to be better, respect to you

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

      Reading this gives me the happy :) Thank you for the kind words!

  • @brqnet8290
    @brqnet8290 Рік тому +2

    I am glad that I found this channel, I love to learn something new like algorithms and complex information rather than seeing basic stuff and useless tutorials,. Keep it up man

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

    After years of visiting this topic, I finally get it. Thanks!

  • @arisweedler4703
    @arisweedler4703 10 місяців тому +2

    This is so incredible. So simple understandable and clear. Well done!!

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

      Thanks for the kind words :)

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

    Very good video; all killer, no filler.

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

      Hehe that's the goal! Thanks for the kind words :)

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

    This is the first explanation I've heard that makes sense.

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

    This is best explanation ever I got about Monad or Functor for that matter!

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

    Very short and sweet explanation! I like how you explained concisely the reason to use monads and how they basically work

  • @5cover
    @5cover 8 місяців тому

    God-tier explanation, extremely concise and easy to understand.
    Thank you!

    • @AByteofCode
      @AByteofCode  8 місяців тому

      Thanks for the kind words!!

  • @sharbelokzan9673
    @sharbelokzan9673 Рік тому +9

    I still don't understand monads 100%,
    But this video is where I can say I got the closest to understand them.
    And the most surprising thing is the video length! I have watched, before this, a lot of other videos about monads, and some of them were really long and thorough, but I consider this one is the best so far.
    I can't be sure whether it's the example you gave or the fact that I'm watching this after watching many similar videos, but this is defiantly QUALITY CONTENT, short, concise, holistic and well-narrate.
    Thankyou very much

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

      This brings a smile to my face :) If you don't plan on going into functional programming, just think of monads as a smart box that does stuff to its contents for you. (Its more than that but the distinction doesn't matter outside of FP)

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

      @@AByteofCode tnx!, yup I think the smart box analogy do it for me now

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

      @@sharbelokzan9673 Ayy that's good to hear! Was considering using that analogy for the video itself but decided to avoid using metaphors

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

      Yeah this is the most concise explanation of a monad I've seen and in a way that a regular programmer would understand.

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

      ​@@AByteofCode Question for you.
      I see the Maybe monad example in this video as a way of relocating many examples of a problematic procedural step ("procedural" in the normal English sense) down to a single isolated location.
      As a result, common problems stemming from that step (in this case, problems with function calls and property accessors) can be handled in common.
      I have an example which I think fits this pattern, and therefore might be a monad.
      Is there a term for a monad which relocates side effects, like state updates/assignment or DOM renders, in much the same way that you relocate function calls and property accessors?

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

    I love you. I was referred to a 12 mins video about monads, I watched all of it and I swear I had no idea what it was talking about. I got the clear idea of what monads are in 2 short minutes.

  • @darwinschuppan8624
    @darwinschuppan8624 9 місяців тому

    Not even 3 minutes, straight to the point and had me saying "oooohhhhh, no f*cking way it was this simple" at the end. 10/10 video

    • @AByteofCode
      @AByteofCode  9 місяців тому

      Thanks for the kind words!

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

    Short and sweet. Very well explained. Thank you!

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

    your content is fresh and I don't see this type of content anywhere else, subbed!

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

      Thanks for the kind words and the sub! I'll try my best to keep the content going :)

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

    You're a gem, my friend. Keep up the great work!

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

    Very cool, much impressed! Glad to have found your channel.

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

      Thank you! I'm also glad you found my channel :)

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

    Wow, I have been developing for 7 years, and I did not know about this, very cool!

    • @AByteofCode
      @AByteofCode  7 місяців тому +1

      Learn something every day!

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

    I absolutely love that your video is very readable. A lot of content creators make content that's unwatchable unless you're a freakin' eagle.

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

      The benefit of spending a whole month on a single video :)

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

    Hands down the best explanation of Monads I have seen on youtube.

  • @sunofabeach9424
    @sunofabeach9424 9 місяців тому +14

    I love how monads are explained with such example that fights JS absurdity

    • @hello-world1
      @hello-world1 8 місяців тому +1

      what is wrong with JS? In fact, it is in JS that this problem can be solved with using optional chaining which keep the code readable and debuggable at the same time.

    • @sunofabeach9424
      @sunofabeach9424 8 місяців тому

      @@hello-world1 chaining is doable in every language that supports OOP. And don't get me started with JS wrongs...

    • @hello-world1
      @hello-world1 8 місяців тому +1

      @@sunofabeach9424 not chaining, optional chaining meaning that if you put .. then the program won't throw if the prop can't be accessed. ok get started let's hear.

    • @sunofabeach9424
      @sunofabeach9424 8 місяців тому

      ​@@hello-world1 ah, I checked what this "?." does. The one thing it can do is just short-circ evaluation. While it is useful at times, it does not let you bind a callback function or manipulate the object this callback is attached to. It is not nearly as powerful as a monad.
      It's funny that this "?." serves one purpose - to make null-checks more compact, while nulls shouldn't be a thing in the first place

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

    this video is so good that im pissed. this concept is literally so simple and yet all the "explanations" existing online are like "hey buddy youre gonna need a computer philosophy degree for this" and then explain nothing. but like this + your clarifying comment make crystal clear sense. im so pissed. great work

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

      Thank you!! The way I see it, monads are SO simple that the phd nerds think that if you don't understand, you're an idiot and so they use complicated examples. Another common pitfall is the whole "explain it in haskell" thing, where if you can understand haskell, you probably know monads already.

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

    Finallyyy i understood it, computerphile video was complicated for me, your small example was really easy to understand

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

      The computerphile video was the first one I saw while researching the topic. I'm gonna go rewatch it see if it makes more sense now. It's a shame that video appears first under the search term monad when all it does is complicate things

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

    Devastating synthesis, straight to the point. Subscribed.

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

      Hearing that gives me the happy :)

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

    This is awesome! Thank you for this easy-to-understand video

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

      Glad you enjoyed it! You're very welcome!

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

    This is awesome! Thank you for the explanation!

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

    So much info in ~3 minutes, great 🔥

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

    This is the best explanation I have ever heard thank you

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

      Your welcome and thanks for the kind words!

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

    Great video. Easy to follow with beautiful graphics. Thanks. :)

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

      Thanks for the kind words :) Glad you enjoyed!

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

    That video is awesome, congrats for the great content!

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

      Thank you for the kind words!

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

    Now yes, a decent quality video. Keep up the good work man!

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

    Easy, to the point explanation, subbed, looking forward to new videos!

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

      Ay thanks! Any specific topics you'd be interested in?

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

    So excited to see what comes next with ur channel, keep up the great work :)

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

      What an interesting coincidence, I'm also excited to see what comes next!

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

    Actually the most understandable explanation and nearly the fastest, didn't expect that from such small channel, keep it up)

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

      Fun fact I had 30 subs when I posted that video :) Thanks for the kind words, I'll definitively keep it up!

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

    strong, powerful, simple, great video

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

    Good Job. You're on the rise!

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

      Yeah its pretty insane. Thanks!

  • @noodle-eater
    @noodle-eater 2 роки тому +3

    This is interesting first time hearing about monad, pretty interesting to try

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

      Good luck with that! I'm glad I saved someone from spending 12 hours watching random youtube videos trying to understand lol

  • @possumkeys
    @possumkeys 9 місяців тому

    Wow, such a short video but better than the 10 to 14 minute videos I've watched. Well done.

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

    honestly pretty cool and well explained

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

    This is lovely. Looking forward to seeing more from you. Subbed!

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

    Great explanation, thanks!

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

    Such a good explanation. Thanks!

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

      You're very welcome! I'm glad I was able to help!

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

    Wow the quality of this content is just unbelievable, keep it going

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

      That is music to my ears! Thanks for the kind words!

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

    Amazing content. Will share this with my NL audience. I'm sure you will blow up

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

    That's some quality content!

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

    I've spent a few hours reading Mark Seemann's blog to first understand the concept, turns out I could have just watched a 3 minute youtube video instead 😂 Excellent

  • @glenospace
    @glenospace Рік тому +2

    Pretty great explanation. Thanks. Would love the video to be longer with more examples.

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

      Thank you!! I have a monad video planned about the category theory definition and a massive functional programming one which'll mention a multitude of monads. But considering the success of the topic, I could definitively see myself make a dedicated video about a ton of different monad types.

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

    Really good explanation for a 2:30 minutes video!

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

      Glad to hear that! (Or is it a good explanation _because_ its 2:30 long and thus without bloat?)

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

    Such a simple and precise explanation... wow, 100% immediate sub, please keep up the nice work!

  • @YashKumar-it5fr
    @YashKumar-it5fr 2 роки тому

    first channel that i subscried after only wathing one video . Amazing content.

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

      Ayyyy glad to hear that and thanks for the kind words!

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

    You earned yourself a follow!

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

    thanks, this was really helpful!

  • @babyboie20
    @babyboie20 2 роки тому +9

    Holy crap, this is super useful and a way of thinking that I haven’t thought of before. Nice work!

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

      Glad I could be helpful! Thanks for the kind words :)

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

    This is the best explanation ever

  • @MightyElemental
    @MightyElemental 8 місяців тому

    I studied haskell during my computer science degree, but this is the first time I've actually understood what a monad is.

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

    I like it, direct to the concept

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

      Another commenter said, "no filler, just killer" and that is a good description of what I strive for :)

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

    Nicely explained!

  • @Ben-cq4db
    @Ben-cq4db Рік тому

    Subscribed at 12.7k! See you at a million in just a bit.

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

    Finally an actual explanation of a monad.

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

      The ironic thing is the video is technically inaccurate, it describes the Endofunctor. For it to be a Monad, the function passed into .bind would need to return an instance of the Monad in question. Although, if you're not a functional programmer, the difference doesn't really matter and since noone knows the nuance, you can still use endofunctors and claim it to be a monad :p

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

      @@AByteofCode nah I really didn't know much about monads I'm just a simple webdev who makes games in part time
      But that pattern looked much familiar to promises

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

      ​@@thatsalot3577 Turns out Javascript promises ARE monads! They were designed like that I believe.

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

    Excellent video!

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

    Great explanation.

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

    subbed for more design paterns + like and comment for the yt algo keep it up man

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

      Thanks man! Any specific design pattern you'd like to hear about?

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

    incredible content this is what the people need

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

    Good!! thanks for this content!

  • @Onidrako
    @Onidrako 13 днів тому

    This... Is pretty cool, thanks!

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

    Brief yet informative and very well presented. Keep growing, friend, I've already contributed and I'm waiting for next videos :)

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

    Love that this video isnt a 2 second video saying "a monad is just a monoid in the category of endofunctors" and actually explains the concept in a practical way

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

      I love that video "what is a monad" where its just a robot reading all the different dictionary definitions and none of them make any sense whatsoever (even talking about non programming uses of monad)

  • @vexular2185
    @vexular2185 Рік тому +2

    Great video!!

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

    This video is more like a text book to teach how to make people subscribe in 2.5mins
    Informative, clear, interactive expression
    Instant subscribed

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

      This comment is music to my ears! And considering the view to sub conversion rate I think you're right :)

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

    I would prefer how F# or ML way to explain this as “function composition”, for chaining functions together in a correct types order like a factory.
    Just that simple.
    In Rust, it use Option so most of time you need to unwrap, but it also can help compose functions with “.” Operator. Which is very convenient and less confusing to people.

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

      I think for OOP users, the dot operator would be quite confusing. There are many ways to explain and the idea of function composition is a pretty good alternative, I mean, I was thinking of using that for this video but thought the pipeline idea would be more intuitive for my target audience of OOP devs

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

      @@AByteofCode would be great if you gather all those languages and compare them in doing this feature.
      Fsharp, Ocaml, Haskell, Rust, Ruby, even JS … ha ha

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

      @@thanatosor Hmm. Not sure what point we'd be trying to prove there. Monads, outside of complex stuff like Promises, aren't really suitable for anything OOP. I just used javascript in this video because my focus was on people just knowing what the word meant and using a language which actually uses monads would have added too much obscurity to be understandable

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

      @@AByteofCode to my latest comment, it’s just my idea, since I tend to make the same thing in different languages.
      Nothing more to prove I guess.
      Not a big fan of JS but I admit that it’s everywhere now.

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

      @@thanatosor Yeah I'm not a big fan of JS (python supremacy) just forced into using it by circumstance (and in videos because everyone knows it so nothing to explain). I guess it could be interesting to have a repertoire of what certain patterns look like in different languages, you're right.

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

    Excellent video bro.

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

    I didn't expect such quality from a ~350 sub channel
    The sound got much better compared to older videos (I think you got a little bit more confident)
    I'll make sure to share your channel with some of my friends to help you grow :)

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

      Hehe and I had 30 subs when I posted that video :) Also thanks for the kind words and help, I appreciate it!

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

      almost 3k subs in just 4 days, so yeah this channel is gonna blow up

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

      ​@@proloycodes That would be a certified pog moment :) If my current growth rate continues for a week I'll be at 10k. In any case, I have a couple of videos planned out that I suspect might check the same boxes as monads do so that might be helpful too. As someone who was hoping for 100 subs by the end of the summer, all of this is absolutely insane!