Closed lambdacore12 closed 1 year ago
That is a great question, and I did consider both in the initial design. As I went through initial revising, I narrowed down the list to language concepts that a new developer would interact with directly. In that list, Events and Delegates were not of them for the following reasons:
Events are a core part of Pub/Sub code architectures commonly found within game and user interface development. However, during research for this roadmap I found these were complex enough that a new developer would typically interact with Events through an abstraction in the framework they are using such as UnityEvent or WinForms's code generation tooling. The reason for this is that there are some notable gotchas with Events that also make it not so much of a beginner concept, namely:
For Delegates, while an important concept, developers usually use the modern wrappers such as Action
and Func
types instead. Each of these handles a bit of the boilerplate usually associated with setting up delegates manually.
Action
is a delegate type with a return type of void
Func
is a delegate type with a return type specified as its last argument in the generic parameters (e.g. Func<bool>
)Side note: I highly recommend Tarodev's video on Events and Delegates, which if you're interested explains these two things well in greater detail!
Thanks for the quick response! I was in the process of learning WPF, but I was unable to advance due the fact that I couldn't work with events and delegates. That's why I went looking for a roadmap that would show me where have I missed these two concepts along the way.
Hello. Thank you for this roadmap. Why are events and delegates not mentioned?