Тёмный

Douglas Crockford: Monads and Gonads (YUIConf Evening Keynote) 

YUI Library
Подписаться 16 тыс.
Просмотров 66 тыс.
50% 1

In this evening keynote from YUIConf 2012, the legendary JavaScript architect Douglas Crockford discusses one of the most elusive of all programming concepts: the monads. With this talk, Crockford attempts to break the long-standing Monad tutorial curse by explaining the concept and applications of monads in a way that is actually understandable to the audience.

Опубликовано:

 

17 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 60   
@jesprotech
@jesprotech 2 месяца назад
I watched this video with already an idea of what monads are, and so I may have a different perspective than others about this. This being a more than 10-year-old video also changes how it sounds when watching it. I don't think this is a boring presentation. It is quite an old-fashioned way to present perhaps, but it does provide code examples. I can see what I have learned in Kotlin about monads completely reflected in this presentation even in current times and that makes it a good presentation in my view and I am very happy to have watched this.
@HenriqueBarcelos
@HenriqueBarcelos 6 лет назад
Watching this in 2018 feels like this talk was given decades ago :'D
@OutOfTheBoxThinker
@OutOfTheBoxThinker 5 лет назад
6 years is a very long time in the JavaScript world!
@runiih
@runiih 7 лет назад
Well, the curse is real.
@artist6000ish
@artist6000ish 8 лет назад
This is the problem with every video I've seen about monads. They all start with: 'We're going to do a better job at explaining monads than every other video on youtube.', but then proceed to make the same fundamental mistake. Instead this is what they should do: 1) show a concrete example of the problem sttement, in the language that the viewer already knows, 2) show the viewer what the typical way to solve the problem, in the way that the reader would likely solve the problem on their own, 3) now tell them what the downside is with their solution and finally 4) show the viewer how monads solves the same problem without the downside.
@WillMruzek
@WillMruzek 8 лет назад
Do you know of a video that does this?
@tonymorris7377
@tonymorris7377 6 лет назад
I am sorry you have had to endure this. Mr Crockford clearly does not know what monad means. This leads to handwavy, non-explanations which confuse aspiring learners even more. I am happy to help you understand this concept, and its practical application, concretely if you would like.
@BrunoArsene
@BrunoArsene 6 лет назад
What is really funny is that today, once again, I decided to finally understand monads. So I was reading a blog post which pointed me to this video. After realising that I still had no clue as to what monads are, I decided to read the comments and saw yours. I wanted to give it a like and realised that I already did, probably some time in the past when I, again, tried to understand monads. My understanding so far is that monads must have something to do with recursion.
@fatcerberus
@fatcerberus 5 лет назад
Anyone still having trouble understanding monads, I wrote a really good tutorial that starts from the ground up (you *can't* start with a box/bag/burrito metaphor, that's a mistake) and explains everything in plain English without the heavy mathematics or Haskell: gist.github.com/fatcerberus/beae4d15842071eab24fca2f0740c2ef Crockford couldn't break the curse, but I'm pretty sure I can.
@mohammadhadialiakbar4486
@mohammadhadialiakbar4486 4 года назад
@@BrunoArsene I think this book is excellent for learning mostly-adequate.gitbooks.io/mostly-adequate-guide/
@kokoloism
@kokoloism 11 лет назад
this man is a prophet - brings the message for the future, and only few can hear him.
@richardseldon5205
@richardseldon5205 10 лет назад
Excellent explanation. For the part where Crockford discusses the MayBe monad, and passing that into the MONAD constructor (mins. ~28) he left out a critical code slide to actually illustrate that the MONAD receives such a modifier parameter. It would look something like var MONAD = function (modifier) ... further down if (typeof modifier === 'function') { modifier(monad, value); } in order to actually invoke it. Otherwise very clear and simple explanations.
@CostaMichailidis
@CostaMichailidis 7 лет назад
Suggesting a slight change. The coloring should distinguish scopes. For example unit and value exist in different scopes ( at 18:00 ), but they're the same color in Doug's example.
@hbi99
@hbi99 11 лет назад
Weird reasoning; "coloring is for kids, I'm a grown up...but I would like to have coloring..." If there was something like a "ReasoningLint", this reasoning would not pass ;-)
@jamestomasino
@jamestomasino 11 лет назад
Someone please build Douglas Crockford's context coloring in vim. I'll give high fives!
@xxhitman1992
@xxhitman1992 3 года назад
it exists for vscode!
@jrencz
@jrencz 11 лет назад
Look! Someone did build it. Search for "JavaScript-Scope-Context-Coloring" on Github (yt won't let me post an URL)
@jimbopaw
@jimbopaw 7 лет назад
Context coloring: github.com/jacksonrayhamilton/context-coloring
@victorb9503
@victorb9503 9 лет назад
the intro history stuff about Fortran kind of resembles Ruby. no curly braces, usage of variables without declaration, etc.
@deadalnix
@deadalnix 11 лет назад
At 51mins, no other language that can do that ? Man you can do that in D and it is dead easy ! I'm pretty sure that many other languages allow that as well.
@HeilTec
@HeilTec 6 лет назад
Interested in the Actor Model: channel9.msdn.com/Shows/Going+Deep/Hewitt-Meijer-and-Szyperski-The-Actor-Model-everything-you-wanted-to-know-but-were-afraid-to-ask ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7erJ1DV_Tlo.html
@ekmett
@ekmett 11 лет назад
1.) The monad is the structure relating the objects, not the objects themselves as he asserts. 2.) His Maybe "monad" isn't the Maybe monad. Maybe can usefully distinguish between Nothing, Just Nothing and Just (Just a), but introspects on the values it is given breaking parametricity and cannot. This has big implications w.r.t. storing nulls in containers. 3.) He spends much of his time arguing against some straw man who says you must learn all of category theory to learn how to use a Monad.
@twoolie88
@twoolie88 11 лет назад
Not to mention Boost has primatives that will perform parallel map over vectors also.
@FrVle
@FrVle 8 лет назад
"Go to yahoo and then google for Monad"... hehehe I love how "staple" has become Google for our society
@NicholasShanks
@NicholasShanks 6 лет назад
He's trolling. He did this talk at Google and said "go to Bing and google for Monad"
@FrVle
@FrVle 4 года назад
@FichDichInDemArsch what the fuck is your problem?
@mywonderer57
@mywonderer57 11 лет назад
Agree: this statement is wrong. parMap in the widely used `parallel` package in Haskell exists for exactly this purpose.
@fisherwebdev
@fisherwebdev 11 лет назад
Is the enqueue function supposed to have a return statement? return queue?
@jasonfeingold2314
@jasonfeingold2314 10 лет назад
FTR, The IO "loophole" in Haskell is more rigorous than described. E.g. you can't just do IO anywhere you want.
@scottburch100
@scottburch100 9 лет назад
I have attempted to take his code and put it in a library and extend it to be more useful. github.com/scottburch/functional I think it has a simpler explanation since I don't go into the details of the code itself. Any feedback is welcome.
@PangeaMinor
@PangeaMinor 9 лет назад
Has the ...args "splat" feature been implemented in newer versions of ECMAScript, then? (Or maybe he's joking?) Edit: He's talking about it around 24:11
@DivjotSingh
@DivjotSingh 9 лет назад
+Miyalys Sign Yup. It's in latest versions of Gecko and V8. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator#AutoCompatibilityTable
@sooooooooooomebody
@sooooooooooomebody 8 лет назад
+Pangea Minor Yes thanks god but the code has other bugs for example the simplest, first version of MONAD should be function MONAD() { return function unit(value) { var monad = Object.create(null); monad.bind = function(func) { func(value); return this; }; return monad; }; } so that monad.bind(foo).bind(bar) actually works im gonna fix this stuff and put it on github or something
@DivjotSingh
@DivjotSingh 9 лет назад
You can use the ideal file system API with promises right now. npm i fs-promise
@twoolie88
@twoolie88 11 лет назад
Memory consumption really is an issue in Javascript. Especially when creating monads which necessarily close over vast number of closures, hamstringing the garbage collector. This will very quickly become an issue on long running client-side apps and especially server applications which must service hundreds of thousands of customers within the same "huge" ram space.
@kahnfatman
@kahnfatman 3 года назад
The talk is great. The Q&A is not worth the time, tho.
@drakefjustin
@drakefjustin 11 лет назад
What does he say at 20:00? Eke mono?
@nodelayShim
@nodelayShim 8 лет назад
OK I understand monad .. and I can not explain what it is!
@Jon47
@Jon47 11 лет назад
"go to yahoo and google for it"
@joergfritsch
@joergfritsch 11 лет назад
Fully agree.
@bbugarschi
@bbugarschi 11 лет назад
first time i saw a talk from crockford i thought he just screwed up :P.
@feihcsim7045
@feihcsim7045 6 лет назад
Anybody build that context colorer yet? lol
@mykhal
@mykhal 11 лет назад
.. it is still cursed, obviously (:
@yootoby
@yootoby 11 лет назад
"Ajax Mondad"? Seriously? That's Method Chaining.... I don't want to live on this planet anymore....
@0polymer0
@0polymer0 7 лет назад
I wanted to point out for later readers that Method Chaining requires the methods already be defined for the type of object operated on. Monadic composition only requires you implement a function that takes a "contained" value and return a "container" value, then bind knows how to string the results together. The method chaining syntax is sugar.
@IrisSoledad
@IrisSoledad 9 лет назад
really interesting video. It would be even better without the stereotyping of Spanish speaking people. You can learn Spanish to talk to business partners, to talk to collaborators across the world, not only to "your workers". You were just shy from saying "you can learn Spanish to talk to your maid or your gardener." Just saying.
@elydelacruz
@elydelacruz 11 лет назад
Ladys look away, DOG BALLS! 38:20
@jethrolarson
@jethrolarson 10 лет назад
Not sure if Crockford is trolling...
@frechjo
@frechjo 6 лет назад
47:50 "Trying to save memory in Javascript... I can't imagine a bigger waste of time" I can, though. Sure, "premature optimization is the root of all evil", but a lot webapps, sites, and HTML5+css+js applications seriously need some love. It's both lazy and ethically questionable to keep pushing all the load to hardware requirements. Lazy because part of your job is to make things that work as intended now, not things that will probably work as the should in 2 years. Ethically questionable, because you put an arbitrary economic barrier to access. "Doesn't work in your computer? Buy a better one". Why? It's just a stupid gallery page that should work on any 10 years old computer! What that way of working does is to push the cost from the company making software to the user buying hardware.
@icilianfenner
@icilianfenner 11 лет назад
that doesn't bode well :p
@elydelacruz
@elydelacruz 11 лет назад
LOl!
@MichaelDougherty11
@MichaelDougherty11 9 лет назад
Awkward distracting stereotype at 11:50
@3amsleep
@3amsleep 9 лет назад
Awkward but true, both in the spanish and the haskell cases.
@williamwest3594
@williamwest3594 9 лет назад
Michael Dougherty It was so distracting I nearly stopped listening to the whole thing. He says the same thing in his Google Techtalk, so it's scripted rather than off the cuff. How disconnected do you have to be to think that that comment isn't totally asshatish?
@renozyx4634
@renozyx4634 11 лет назад
I couldn't listen to the full talk: he is too annoying..
@eric2718281
@eric2718281 11 лет назад
I really hope this smug, sloppy presentation style doesn't catch on. Crockford may have had something useful to say about implementing monads in Javascript, but it is lost in a fog of arrogance and misrepresentation.
Далее
Douglas Crockford: Quality
48:23
Просмотров 21 тыс.
The Next Programming Language by Douglas Crockford
31:49
Merab vs Sean underway!! 🚨 #ufc306
00:23
Просмотров 1,3 млн
Inside Out 2: BABY JOY VS SHIN SONIC
00:19
Просмотров 3,8 млн
Monads and Gonads
49:47
Просмотров 146 тыс.
Douglas Crockford: The JSON Saga
49:26
Просмотров 73 тыс.
The Post JavaScript Apocalypse - Douglas Crockford
46:40
Douglas Crockford: Really. JavaScript.
46:10
Просмотров 81 тыс.
Syntaxation • Douglas Crockford • GOTO 2013
49:40
Brian Beckman: Don't fear the Monad
1:07:10
Просмотров 400 тыс.