Home > Store > Programming > Windows Programming

larger cover

Add To My Wish List

Register your product to gain access to bonus material or receive a coupon.

C# Puzzlers (Video Training)

Online Video

  • Your Price: $149.99
  • About this video
  • Accessible from your Account page after purchase. Requires the free QuickTime Player software.

    Videos can be viewed on: Windows 8, Windows XP, Vista, 7, and all versions of Macintosh OS X including the iPad, and other platforms that support the industry standard h.264 video codec.

Not for Sale

Also available in other formats.

  • Description
  • Sample Content
  • Updates
  • Copyright 2012
  • Edition: 1st
  • Online Video
  • ISBN-10: 0-13-294610-6
  • ISBN-13: 978-0-13-294610-0

How well do you know C#?  Put your knowledge to the test in Bill Wagner’s C# Puzzlers video LiveLesson!

 

Bill Wagner’s C# Puzzlers exposes common misconceptions that developers have about the C# language. Misconceptions occur when developers are unclear about how language features interact. On other occasions, a lack of understanding about how a single features works, can stump and frustrate the most experienced developer.

Using the “Puzzler” format, Bill demonstrates these misconceptions using small code samples; he then explores different ways for you to modify the code until its behavior is correct.

This collection of Puzzlers is divided into seven sections. Each section delves into the rules that govern aspects of the C# language that developers find most confusing: 

 

I.             Generics

II.            Method Resolution

III.           Named and Optional Parameters

IV.          LINQ

V.            Value and Reference Semantics

VI.          Dynamic Programming in C#

 

The introductory puzzle introduces the format using a puzzle, and discusses some of the nuances of object construction.

 

I.         Generics

Generics are still one of the most important aspects of the .NET environment and the C# language. So many of the features we use every day are built upon generics in one way or another. Generics are still a complicated feature. You must create code whose types are not known until runtime. The compiler must generate IL with minimal information about the actual types that will be represented by the type parameters.  The JIT must convert that IL into executable code and plug in the real types for the type parameters. Finally, the meta data carried along must include information that enables reflection and other advanced techniques to work correctly.

Puzzle 1 - Operations on Generic Type Parameters

 What information gets conveyed, and what information cannot get used when a real type is substituted for a type parameter?

Puzzle 2 - Generics and Specializations

What happens when you create overloads for generic methods?

Puzzle 3 - Generics and Variance

How do generics and arrays differ with respect to variance?

Puzzle 4 - Generics, Constraints and Overloads

How does the compile choose between different candidate generic methods?

 

II.        Method Resolution

The rules that govern method resolution in C# are necessarily complex. The features the community has asked for and the team has implemented have only added more complexity to those rules with each new release of the C# language. If you want to be a strong C# developer, you need to have at least a working knowledge of these rules.

Puzzle 5 - Overloading base class methods

What happens when derived classes create overloads of base class methods?

Puzzle 6 - Overloaded methods and null parameters

How does the compiler resolve overloaded methods when you use null parameters?

Puzzle 7 - Overloaded methods and null parameters revisited

What if the overloaded parameter types are unrelated?

Puzzle 8 - Overloaded methods and null parameters and Generics

What if one of the methods is generic?

 

III.      Named and Optional Parameters

Named and optional parameters sound so simple at first examination. But this feature has significant implications on other features in the language. It also has significant implications on areas as fundamental as how parameters are passed to called methods.

Puzzle 9 - Optional parameters and constructors

When is a default constructor not a default constructor?

Puzzle 10 - Optional Parameters and Overloads

Which is the better match?

Puzzle 11- Evaluation of Named Parameters

When do parameters get evaluated? Why does it matter?

 

IV.      LINQ

LINQ introduced totally new ways of constructing and organizing programs. There were new rules related to how you wrote algorithms.  Those rules still cause developers confusion in some cases.

Puzzle 12 - Bound Variables

When are LINQ queries evaluated?

Puzzle 13 - Method calls in LINQ queries

How does LINQ process expressions and method calls?

 

V.        Value and Reference Semantics

Reference types and value types behave differently in many important ways. They also behave the same in many other ways. It can be difficult to keep those differences in mind as you get too accustomed to the similarities.

Puzzle 14 - Value type Semantics

When does copying values hurt?

Puzzle 15 - Value types and events

What happens when value types receive event notifications?

 

VI.      Dynamic Programming in C#

Dynamic extensions move many of the common tasks that were performed by the compiler to runtime libraries. The interplay between static and dynamic typing creates new complications in C# programs.  This section discusses some of the most common ways where static and dynamic types interact in ways that can be surprising.

Puzzle 16 - Dynamic Types and Extension Methods

How do dynamic types interact with extension methods?

Puzzle 17 - Anonymous types and Dynamic Methods

Under what conditions can anonymous types be treated dynamically?

Puzzle 18- Creating Dynamic Types in C#

Why would you pick different ways to implement dynamic types?

 

 

Table of Contents

Introduction

Introductory Puzzle

Puzzle 1 - Operations on Generic Type Parameters

 What information gets conveyed, and what information cannot get used when a real type is substituted for a type parameter?

Puzzle 2 - Generics and Specializations

What happens when you create overloads for generic methods?

Puzzle 3 - Generics and Variance

How do generics and arrays differ with respect to variance?

Puzzle 4 - Generics, Constraints and Overloads

How does the compile choose between different candidate generic methods?

Puzzle 5 - Overloading base class methods

What happens when derived classes create overloads of base class methods?

Puzzle 6 - Overloaded methods and null parameters

How does the compiler resolve overloaded methods when you use null parameters?

Puzzle 7 - Overloaded methods and null parameters revisited

What if the overloaded parameter types are unrelated?

Puzzle 8 - Overloaded methods and null parameters and Generics

What if one of the methods is generic?

Puzzle 9 - Optional parameters and constructors

When is a default constructor not a default constructor?

Puzzle 10 - Optional Parameters and Overloads

Which is the better match?

Puzzle 11- Evaluation of Named Parameters

When do parameters get evaluated? Why does it matter?

Puzzle 12 - Bound Variables

When are LINQ queries evaluated?

Puzzle 13 - Method calls in LINQ queries

How does LINQ process expressions and method calls?

Puzzle 14 - Value type Semantics

When does copying values hurt?

Puzzle 15 - Value types and events

What happens when value types receive event notifications?

Puzzle 16 - Dynamic Types and Extension Methods

How do dynamic types interact with extension methods?

Puzzle 17 - Anonymous types and Dynamic Methods

Under what conditions can anonymous types be treated dynamically?

Puzzle 18- Creating Dynamic Types in C#

Why would you pick different ways to implement dynamic types?

FREE

ONE MONTH ACCESS!

WITH PURCHASE


Get unlimited 30-day access to thousands of Books & Training Videos about technology, professional development and digital media If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months.