You are previewing C# in Depth, Second Edition.

C# in Depth, Second Edition

Cover of C# in Depth, Second Edition by Jon Skeet Published by Manning Publications

Chapter 13. Minor changes to simplify code

This chapter covers

  • Optional parameters
  • Named arguments
  • Streamlining ref parameters in COM
  • Embedding COM primary interop assemblies
  • Calling named indexers declared in COM
  • Generic variance for interfaces and delegates
  • Changes in locking and field-like events

Just as in previous versions, C# 4 has a few minor features that don’t merit individual chapters to themselves. In fact, there’s only one really big feature in C# 4—dynamic typing—which we’ll cover in the next chapter. The changes we’ll cover here just make C# that little bit more pleasant to work with, particularly if you work with COM on a regular basis. These features generally make code clearer, remove drudgery from COM calls, or simplify ...

The best content for your career. Discover unlimited learning on demand for around $1/day.