Тёмный

Thirteen ways of looking at a Turtle - Scott Wlaschin 

NDC Conferences
Подписаться 195 тыс.
Просмотров 34 тыс.
50% 1

In this fast-paced talk, I'll start with the well known API for turtle graphics, and then stretch it to the breaking point by creating 13 different implementations, each demonstrating a different functional programming technique.
Along the way, we'll use partial application, functional dependency injection, validation with Success/Failure results, the Either monad, the State monad, agents with message queues, event sourcing, stream processing, capability-based design, and the interpreter pattern (aka free monad). Phew!
If you're an FP-curious developer, I hope this will be a useful way to get an quick overview of functional programming in practice.
NDC Conferences
ndc-london.com
ndcconferences.com

Наука

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

 

30 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 34   
@Nellak2011
@Nellak2011 2 месяца назад
I had no idea these patterns existed. My knowledge capped out around the result returning function. The interpreter pattern blew my mind and reminded my of Clojure's philosophy of "its just data!".
@ChristianLeovido
@ChristianLeovido 4 года назад
1. Object Oriented Turtle 2:22 2. Abstract Data Turtle 6:58 3. Functional Turtle 8:31 4. State Monad 11:51 5. Error Handling 16:47 5½. Async Turtle 21:42 6. Batch Commands 24:24 7. Actor Model 29:02 8. Event Sourcing 31:25 9. Stream Processing 37:35 10. OO Style Dependency Injection 44:07 11. FP Style Dependency Injection 46:26 12. Interpreter 50:31 13. Capabilities 58:58
@curiosdevcookie
@curiosdevcookie 3 года назад
Christian Ray Leovido Thank you!
@vikingthedude
@vikingthedude Год назад
Are you the best thing since sliced bread
@orlandoboffill7448
@orlandoboffill7448 7 лет назад
Best tech educator IMO
@imadetheuniverse4fun
@imadetheuniverse4fun 2 года назад
the signature coughing boi in audience of every functional programming video on youtube is indeed present 😂
@ryanpalmer8180
@ryanpalmer8180 6 лет назад
Fantastic as always, I learn so much in such a short space of time but it's effortless. Clear and concise.
@curiosdevcookie
@curiosdevcookie 3 года назад
Also, as a consequence, so easy to grasp AND to retain. Many teacher don’t reach either levels, a few manage to make themselves understood rather well but pertaining to Mastery is that the students will be able to additionally to having understood also to retrieve the connections made from their memory some days later. Hope this makes sense!
@couryditch8752
@couryditch8752 6 лет назад
Scott, thank you so much, such a pleasure watching this. So much useful knowledge in this talk.
@SeraphimEmmadaio
@SeraphimEmmadaio 4 года назад
This is such an enlightening talk format. Giving solutions rather than scoped problems is a great way to teach! Love this talk!
@detaaditya6237
@detaaditya6237 4 года назад
An absolutely wonderful talk! Such an eye opener for me
@dcuccia
@dcuccia 6 лет назад
Brilliant talk - thank you very much Scott Wlaschin.
@amirchip
@amirchip 7 лет назад
Superb talk! I always enjoy Scott's talks :)
@trampflips101
@trampflips101 2 года назад
6:16: Is a black-box always a bad thing though? You only need to read the API the class gives you and then can use it. 11:04: You could argue that the tOOtle is also easy to reason about if you only care about reading the API it exports - Turtle(initialState), move(where), penUp(), penDown(), is pretty easy to understand. The point about the functional turtle being easy to test because you can just set the state upon construction so that it's in a particular corner also applies to the tOOtle, also just set the initial state via the constructor. You can also emulate the composition/piping shown at 11:00 by returning a reference to the turtle in each of its calls. That way you can Turtle(initialState).move(50).turn(20).move(50)... and so on. The only difference is the state is only known to the turtle, which is actually a benefit, considering he lists the state having to be managed by the client as a disadvantage of the functional turtle. Don't get me wrong, I think the functional turtle is really nice (it is particularly better when it comes to passing in dependencies), but I think the tOOtle was trashed a little too harshly, I don't think it being familiar is the only benefit is has.
@thalesofthewell
@thalesofthewell 6 лет назад
30 minutes in, mind completely blown
@driziiD
@driziiD 4 года назад
this man is simply brilliant!
@mohamedfouad2304
@mohamedfouad2304 5 лет назад
You had me at the turtle slide... damn cute :)
@RationalWe
@RationalWe 7 лет назад
Scott is the best
@NillKitty
@NillKitty 3 года назад
All 13 of these can be implemented in C# equally as well as F#.
@davidporterrealestate
@davidporterrealestate 5 лет назад
The throat clearing kept me awake
@TheUArabej
@TheUArabej 4 года назад
As soon as I read this - he cleared his throat. I wish you hadn't said that - now i am distracted every time he does that
@oscarasterkrans9301
@oscarasterkrans9301 4 года назад
It was all planned. :-D The bell was a genius move that makes the structure of the presentation very clear.
@greenmind2k
@greenmind2k 6 лет назад
@50:20 - I have a "Disadvantage" for #11 - "FP style dependency injection" (currying) approach: Let's say I have a Data module that contains all the functions needed to query and update my data store. Each one of these functions requires a connection string at the very minimum, and probably a logger function. So if I have 25 Data functions, then I will have to manually create 25 partially applied functions in my application's composition root. Additionally, every time I create a new function in my Data module, I will have to create boiler plate code to partially apply the new functions. I hate repeating myself, so that will quickly feel like tedious work to me. I think that counts as a disadvantage of this approach. On the other hand, I could simply fall back to OOP and create a DataRepository class (instead of a module) that takes a connection string and a logger in its constructor. Then I will have eliminated all the unnecessary boiler plate code of manually partially applying each and every function. Since F# combines OOP with FP, why not take advantage of the strengths of each?
@greenmind2k
@greenmind2k 6 лет назад
Btw, great talk! I thoroughly enjoyed it, as I have enjoyed all of your talks.
@dcuccia
@dcuccia 6 лет назад
I had the same thought. Maybe the question then is - how can the boilerplate be written once and stored/shared, such that we get back the encapsulation you'd want from a OO constructor/IOC injector? Functional AOP, if you will.
@mxBug
@mxBug 5 лет назад
As long as all of the functions in question have the same (curried) interface, you can indeed create a unified context for them which preserves their dependencies using pure FP abstractions. In Haskell and similar languages, you might use the Reader monad or the Context monad, which express the idea of a context in which multiple operations share the same dependencies in a generic way. In F#, these kinds of computation contexts are provided by "builders", which allow you to build "computation expressions". More info here: fsharpforfunandprofit.com/series/computation-expressions.html
@pauldzim
@pauldzim 5 лет назад
Should have done it in Fortran
@clearz3600
@clearz3600 6 лет назад
Couldn't watch it with that noise or cough or what ever it fkin was. I'm sure it was a great talk.
@silpheedTandy
@silpheedTandy 4 года назад
i had a lot of trouble with it, too. gladly, he doesn't clear his throat in the other talk he gives. i wonder (honest question) how possible it would be for some computer program to identify all the frames where he clears his throat (and mute the audio there)? i know nothing about sound, so i don't know if this is an easy problem or difficult problem.
@silpheedTandy
@silpheedTandy 4 года назад
aha! i found the same talk from a different conference: vimeo.com/221105519
@clearz3600
@clearz3600 4 года назад
@@silpheedTandy Thats interesting. Id say it wouldn't be very difficullt using even traditional algorithms [fourier transform?] considering that the amplitute of the cough is so much higher than his regular talking voice. You could probably use machine learning techniques to do it also.
@slaweks81
@slaweks81 4 года назад
OO sample is wrong by design. Another fp guy who uses strawman rhetoric trick:/
@aBamieh
@aBamieh 4 года назад
enlighten us please
@detaaditya6237
@detaaditya6237 3 года назад
How do you think is the right design?
Далее
Domain Modeling Made Functional - Scott Wlaschin
51:35
I'm Excited To see If Kelly Can Meet This Challenge!
00:16
IQ Level: 10000
00:10
Просмотров 3,5 млн
Reinventing the Transaction Script - Scott Wlaschin
1:01:04
Designing with Capabilities - Scott Wlaschin
43:28
Просмотров 10 тыс.
The moment we stopped understanding AI [AlexNet]
17:38
Просмотров 811 тыс.
F# for C# programmers - Scott Wlaschin
1:00:01
Просмотров 68 тыс.
The mind behind Linux | Linus Torvalds | TED
21:31
Rust and RAII Memory Management - Computerphile
24:22
Просмотров 221 тыс.
АЙФОН Г0ВН0
0:54
Просмотров 1,5 млн
#engineering #diy #amazing #electronic #fyp
0:59
Просмотров 2,4 млн
#samsung #retrophone #nostalgia #x100
0:14
Просмотров 12 млн