Home > Articles > Programming > .NET and Windows Programming

Programming with Generic Delegates in .NET

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
Generic delegates combine three powerful technologies: Lambda expressions, generics, and delegates. You'll find these elements everywhere in new versions of .NET. Paul Kimmel explains just how straightforward they really are.

Introduction

Sometimes I suspect that programmers learning their craft in the last five years got to skip a bunch of junk—like Dynamic Data Exchange (DDE), C, MAKE files, and assembler programming—and instead focus on the "good stuff." But, in truth, programming is evolutionary: Learning that "junk" really gives you a profound knowledge of how programs work and an easy understanding of new language features like Lambda expressions (as long as you keep learning).

The key to being a good programmer is never stop learning—and occasionally go back and fill in the blanks. Write some C and C++. Try your hand at assembler and make sure that you learn about delegates and anonymous delegates. They’ll help you to understand Lambda expressions. If you haven’t mastered generics (templates in C++), go back and study that material. Having a full toolbox of programming options is hypercritical to making magic.

In this article, we look at generic delegates; specifically, Action<T>, Func<T>, and Predicate<T>. These delegates are used everywhere in .NET now, and they encompass a lot of critical skills. Toward that end, let’s start our little odyssey.

  • Share ThisShare This
  • Save To Your Account

Discussions

comments powered by Disqus

Related Resources

Dennis Ritchie--May He Rest in Peace...
By on October 16, 2011Comments
Time to Remember a True Computing Pioneer...


ThinApp: Applying a Thin Wrapper
By on September 5, 2011Comments

Traenk encourages all of us to explore the ThinApp application wrapper...


Tell Me What You *Really* Think
By on August 25, 2011Comments

As the fall conference approaches the “eleven weeks out” milestone, I have been thinking about the ways conference participants and conference organizers communicate. Of course, one of the ways is through the evaluations.

See All Related Blogs

Informit Network