I've generally made a mess of teaching this topic... This is the best way I've ever seen it explained and I will likely be referring folks this video from now on. Deborah, you have such a talent for explaining things in a digestible way. Right after I landed a dev job in a .NET shop in 2016, I found your article "Practical Uses of Lambdas" in an old CODE magazine from 2010 they had at the office and I've been following your content ever since. Your C# content really helped me thrive there. Such superb content for a long time. It's really cool to see your content do the same for the Angular community.
Thank you so much for the kind words! Glad to hear the video was useful. And it's amazing that you found an old CODE magazine! Good to hear that was useful as well! (Unlike Angular, C# hasn't changed that much in these past 20+ years. LOL) All the best. 😊
Great video, very well explained! Not gonna lie, I'm not a fan of currying personally. In Typescript it does feel like an unfavorable trade off: You WIN a small reduction of trivial boilerplate but you LOOSE a lot of clarity and readability. Maybe I am just too untrained on the pattern, but right now I feel like I need AT LEAST 10 time as much time to comprehend a method with currying in comparison to a "normal" method. Maybe this dwindles a bit with more experience in writing/reading curry'd methods?
Thanks! And yes, readability/understandability is important, especially when working on a team. I'm seeing this as something more useful for those building their own framework or set of tools for their team. If a company wants to build their own NgRx types of tools, for example, they may need something like this. Also, I hadn't seen this technique until recently, so thought it would be good to share. 😊
Thanks 🙏. Whenever I write code the only thing in my mind is to follow DRY as it leads to implement different patterns. I was thinking of learning currying practically and here your video came. Last 2 videos are for coders who want to write optimized code...Very well articulated video...thanks
Great video Deborah! Like it a lot. In every video of yours, I learn something new. Same thing can be said about your Pluralsight courses. I really appreciate it. Thank you very much!
I wish I had this video back in 2002 to explain what curry is. I’m familiar with it from having worked in c and c++ but never quite understood it from a very dry academic perspective. I’ll have to keep an eye out in my code for when I’m passing in the same argument over and over again and try and use this technique.
Yep. I didn't mean to imply it couldn't be done. Currying is just redefining functions after all. My point was that currying isn't something you normally learn (or even hear about) in languages such as C#.
Thank you. And yes, the more generalized the code the more difficult it is to read. That's why many of these techniques are only used when creating function libraries/frameworks that can be used without needing to know their details.
So in this case, obviously because we're using Javascript, I would just use call() or bind() for creating a function with a hard first argument. Are these just native currying functions in JS, so you don't have to complicate your code syntax writing your own nested functions everywhere you need to use this?
Great video once again Deborah! One stupid question though, why do you create a new array each time in the first example instead of using push(). Arrays are passed by reference right, so that would also take away the reassignment issue?
Thank you! And there's no such thing as a stupid question. 😄 Yes! Using push() would get rid of the reassignment issue. But then we wouldn't be following immutability principles (which are important now that we are using signals). For my simple case, yes, I could have used push and minimized the additional repeated code.
Hi, I am new to angular. Currently I am going through your pluralsight "angular getting started" course. However it is not updated with angular 18. So, should I go through course? Also, are you planning to update it to latest?
Welcome to the Angular family! Sadly, Pluralsight won't allow me to update the course. 😞 You can watch the course if you are interested in understanding the basics of how Angular works. But don't bother with "coding along" as there are lots of little things that no longer work. You could also watch `Angular Fundamentals`, but that is also several versions behind at this point. If you watch the course for the basics, you could learn about many of the new features by watching my RUclips videos. Here is the playlist of new Angular topics such as standalone components, and the new template syntax: ruclips.net/p/PLErOmyzRKOCrzJ9zUEGgC1zVzVGt3hMmV&si=vvgz5cfGoHMxIYol And here is a playlist of the new Angular signals: ruclips.net/p/PLErOmyzRKOCr07Kcnx75Aqh6PWSbIokPB&si=UjmaSe4J7CK2B7Cw
Thank @HenrikBgelundLavstsen for clarification. I am in midway of the course and to be honest she is best, her teaching style. Everything going in mind smoothly.
Again a good one! Thanks for doing these vids. I always admire that you avoid any shortcuts while explaining something. Somehow related to the topic of the video (functions as objects): I started to add pre-configured functions (or curried functions) to my Observables. Then the template just needs to call a method that is part of the data. If it is bound to a button, if the funcition is null, the button is disabled. So - for example - a list of snacks has not only a property for the name but also for a function (without parameters) that will delete exactly that snack. I would be interested what you think of that approach.
Great to hear they are useful. I'm not sure I am100% follow what you are suggesting. Can you do a stackblitz with an example? (The comments appear to block any links from anyone by me, so you may have to add spaces to a stackblitz link to include it in a comment.)
I am not sure if you can see all the forks of your projects on stackblitz. But I have forked your Angular Paging API project and made some changes there.
@@deborah_kurata I meant, that you don't need currying for frontend. There is always a simpler solution that complies with DRY, even in your artificial example.
@@tiberseptim7183 Got it. I agree that most front end developers would not need currying. I think it would primarily be used by anyone building a library or framework. For example, a company wants to build its own state management library for use by its Angular developers.
I've generally made a mess of teaching this topic... This is the best way I've ever seen it explained and I will likely be referring folks this video from now on.
Deborah, you have such a talent for explaining things in a digestible way. Right after I landed a dev job in a .NET shop in 2016, I found your article "Practical Uses of Lambdas" in an old CODE magazine from 2010 they had at the office and I've been following your content ever since. Your C# content really helped me thrive there. Such superb content for a long time. It's really cool to see your content do the same for the Angular community.
Thank you so much for the kind words! Glad to hear the video was useful.
And it's amazing that you found an old CODE magazine! Good to hear that was useful as well! (Unlike Angular, C# hasn't changed that much in these past 20+ years. LOL)
All the best. 😊
Great video, very well explained!
Not gonna lie, I'm not a fan of currying personally. In Typescript it does feel like an unfavorable trade off: You WIN a small reduction of trivial boilerplate but you LOOSE a lot of clarity and readability.
Maybe I am just too untrained on the pattern, but right now I feel like I need AT LEAST 10 time as much time to comprehend a method with currying in comparison to a "normal" method.
Maybe this dwindles a bit with more experience in writing/reading curry'd methods?
Thanks!
And yes, readability/understandability is important, especially when working on a team.
I'm seeing this as something more useful for those building their own framework or set of tools for their team. If a company wants to build their own NgRx types of tools, for example, they may need something like this. Also, I hadn't seen this technique until recently, so thought it would be good to share. 😊
Great explanations as usual thank you a lot
Thank you! 😊
Great stuff, Deborah, thank you very much!
Glad to hear. Thank you!
Thanks 🙏. Whenever I write code the only thing in my mind is to follow DRY as it leads to implement different patterns. I was thinking of learning currying practically and here your video came. Last 2 videos are for coders who want to write optimized code...Very well articulated video...thanks
Thank you so much for your kind words. Glad to hear that they are useful!
I really enjoy your content, thanks for sharing, love your easy to understand explanations 😁
Awesome, thank you! 😊
Great video Deborah!
Like it a lot.
In every video of yours, I learn something new. Same thing can be said about your Pluralsight courses.
I really appreciate it.
Thank you very much!
That is wonderful to hear. So glad the videos are useful. Thank you!
@@deborah_kurata Thank you Deborah!
Great. Awesome presenting
Thank you! 😊
I wish I had this video back in 2002 to explain what curry is. I’m familiar with it from having worked in c and c++ but never quite understood it from a very dry academic perspective. I’ll have to keep an eye out in my code for when I’m passing in the same argument over and over again and try and use this technique.
It's one of those things that you may not use often, but is useful when you do need it. 😊 Thank you!
Excellent!! One more tool added to the box. Thanks
Nice! Thanks for watching!
In C#, it's pretty easy to define a custom Curry delegate like:
delegate Func Curry(T1 arg1);
It's not common but can definitely be done.
To avoid nasty Func
Yep. I didn't mean to imply it couldn't be done. Currying is just redefining functions after all. My point was that currying isn't something you normally learn (or even hear about) in languages such as C#.
another awesome tutorial! I tried to understand that watiching some other videos but here I finally got that! Thank you :)
Glad it helped! Thank you for watching!
Great job! Although i believe it is not readable, it is still good to know!
Thank you. And yes, the more generalized the code the more difficult it is to read. That's why many of these techniques are only used when creating function libraries/frameworks that can be used without needing to know their details.
So in this case, obviously because we're using Javascript, I would just use call() or bind() for creating a function with a hard first argument. Are these just native currying functions in JS, so you don't have to complicate your code syntax writing your own nested functions everywhere you need to use this?
Great video once again Deborah! One stupid question though, why do you create a new array each time in the first example instead of using push(). Arrays are passed by reference right, so that would also take away the reassignment issue?
Thank you! And there's no such thing as a stupid question. 😄
Yes! Using push() would get rid of the reassignment issue. But then we wouldn't be following immutability principles (which are important now that we are using signals). For my simple case, yes, I could have used push and minimized the additional repeated code.
great as always!
Thank you so much!
Hi, I am new to angular. Currently I am going through your pluralsight "angular getting started" course. However it is not updated with angular 18. So, should I go through course? Also, are you planning to update it to latest?
its fine to learn older versions. Lots of the basics stay the same, just a few newer features added.
Welcome to the Angular family!
Sadly, Pluralsight won't allow me to update the course. 😞
You can watch the course if you are interested in understanding the basics of how Angular works. But don't bother with "coding along" as there are lots of little things that no longer work. You could also watch `Angular Fundamentals`, but that is also several versions behind at this point.
If you watch the course for the basics, you could learn about many of the new features by watching my RUclips videos.
Here is the playlist of new Angular topics such as standalone components, and the new template syntax: ruclips.net/p/PLErOmyzRKOCrzJ9zUEGgC1zVzVGt3hMmV&si=vvgz5cfGoHMxIYol
And here is a playlist of the new Angular signals: ruclips.net/p/PLErOmyzRKOCr07Kcnx75Aqh6PWSbIokPB&si=UjmaSe4J7CK2B7Cw
Thank @HenrikBgelundLavstsen for clarification. I am in midway of the course and to be honest she is best, her teaching style. Everything going in mind smoothly.
Thanks @@deborah_kurata for clarification.
I guess this is the only video I understood the real purpose of currying... But still wouldn't write it myself 😅
Yeah, this seems like something that would mostly be used by library authors. But it's good to understand what it is. 😊
@@deborah_kurata for sure 💯
Again a good one! Thanks for doing these vids.
I always admire that you avoid any shortcuts while explaining something.
Somehow related to the topic of the video (functions as objects): I started to add pre-configured functions (or curried functions) to my Observables. Then the template just needs to call a method that is part of the data. If it is bound to a button, if the funcition is null, the button is disabled. So - for example - a list of snacks has not only a property for the name but also for a function (without parameters) that will delete exactly that snack.
I would be interested what you think of that approach.
Great to hear they are useful.
I'm not sure I am100% follow what you are suggesting. Can you do a stackblitz with an example?
(The comments appear to block any links from anyone by me, so you may have to add spaces to a stackblitz link to include it in a comment.)
@@deborah_kurata angular-paging-api-deborahk-qz6c18
@@deborah_kurata Hi, i have no luck with answering here. Whenever I include a link - even an obscured one - my message gets deleted.
I am not sure if you can see all the forks of your projects on stackblitz. But I have forked your Angular Paging API project and made some changes there.
Maybe the id of the fork will help. It is qz6c18
Good thing about currying - you never gonna need it, if you are not working with lambda calculations
Could you elaborate on that? I'm not sure I follow.
@@deborah_kurata I meant, that you don't need currying for frontend. There is always a simpler solution that complies with DRY, even in your artificial example.
@@tiberseptim7183 Got it. I agree that most front end developers would not need currying.
I think it would primarily be used by anyone building a library or framework. For example, a company wants to build its own state management library for use by its Angular developers.