Home > Store > Programming > Windows Programming

C# Puzzlers (Video Training)

C# Puzzlers (Video Training)

Your browser doesn't support playback of this video. Please download the file to view it.

Downloadable Video

  • Your Price: $119.99
  • List 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.

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

Buy Lessons

DRM-Free Video Downloads. Purchase and immediately download individual lessons from this video. Make your lesson selections below and click on the Buy button.

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. Requires the free QuickTime Player software.

Lesson 1

Introduction to Puzzle Construction Order and General Puzzle Format

In 2010 Bill Wagner gave a series of C# Puzzlers presentations at a number of U.S. based user groups and CodeMash events.  All were put to the test with intermediate level developers who tried to break, workaround, and outsmart the code.  Bill's puzzlers were so well received, that he is now being regularly asked to present them.  With each talk he acquires more thought provoking range of questions for the audience. This series of videos addresses many of those puzzling questions.  The focus is on C# 4.0 and each Puzzler will take about 15-20 minutes. Each puzzle will show a reasonably small piece of code and then ask readers to guess what the code does. The author will show what the code does, and why many developers believe it would behave differently. Then, he'll discuss how you could write the code differently to accomplish the same result without the misconceptions.

Duration: 00:09:38  File Size: 14 MB

Lesson 2

Puzzle 1: Operations on Generic Type Parameters

 Puzzle 1 teaches the concepts of what information gets conveyed, and what information cannot get used when a real type is substituted for a type parameter.

Duration: 00:14:33  File Size: 21 MB

Lesson 3

Puzzle 2: Generics and Specialization

Puzzle 2 shows happens when you create overloads for generic methods.

Duration: 00:07:26  File Size: 12 MB

Lesson 4

Puzzle 3: Generics and Variance

Puzzle 3 teaches how generics and arrays differ with respect to variance.

Duration: 00:10:07  File Size: 19 MB

Lesson 5

Puzzle 4: Generics, Constraints, and Overloads

Puzzle 4 teaches how the compile chooses between different candidate generic methods.

Duration: 00:10:15  File Size: 19 MB

Lesson 6

Puzzle 5: Overloading Base Class Methods

Puzzle 5 teaches what happens when derived classes create overloads of base class methods.

Duration: 00:07:01  File Size: 12 MB

Lesson 7

Puzzle 6: Overloading Methods and Null Parameters

Puzzle 6 teaches how the compiler resolves overloaded methods when using null parameters.

Duration: 00:06:05  File Size: 10 MB

Lesson 8

Puzzle 7: Overloading Methods and Null Parameters Revisited

Puzzle 7 addresses the question "What if the overloaded parameter types are unrelated?"

Duration: 00:05:53  File Size: 10 MB

Lesson 9

Puzzle 8: Overloading Methods and Null Parameters and Generics

Puzzle 8 address What if one of the methods is generic?

Duration: 00:04:38  File Size: 8 MB

Lesson 10

Puzzle 9: Optional Parameters and Constructors

Lesson 9 teaches the concept of "When is a default constructor not a default constructor"?

Duration: 00:06:15  File Size: 11 MB

Lesson 11

Puzzle 10: Default Parameters and Overrides

Lesson 10 is on evaluations of named parameters; which is the better match?

Duration: 00:04:33  File Size: 8 MB

Lesson 12

Puzzle 11: Evaluation of Named Parameters

Puzzle 11 covers when do parameters get evaluated and teaches why it matters.

Duration: 00:07:20  File Size: 14 MB

Lesson 13

Puzzle 12: Bound Variables

Puzzle 12 addresses "When are LINQ queries evaluated?"

Duration: 00:09:11  File Size: 16 MB

Lesson 14

Puzzle 13: Method Calls in LINQ Queries

Puzzle 13 teaches "How does LINQ process expressions and method calls?"

Duration: 00:10:46  File Size: 19 MB

Lesson 15

Puzzle 14: Value Type Semantics

Puzzle 14 addresses when copying values hurt.

Duration: 00:06:18  File Size: 12 MB

Lesson 16

Puzzle 15: Value Types and Event Handlers

Puzzle 15 addresses what happens when value types receive event notifications.

Duration: 00:07:04  File Size: 12 MB

Lesson 17

Puzzle 16: Dynamic Types and Extension Methods

Puzzle 16 teaches how dynamic types interact with extension methods.

Duration: 00:06:47  File Size: 12 MB

Lesson 18

Puzzle 17: Anonymous Types and Dynamic Methods

Puzzle 17 answers the question "Under what conditions can anonymous types be treated dynamically?"

Duration: 00:05:26  File Size: 9 MB

Lesson 19

Puzzle 18: Creating Dynamic C# Types

Puzzle 18 asks why would you pick different ways to implement dynamic types?

Duration: 00:09:46  File Size: 21 MB

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Your browser doesn't support playback of this video. Please download the file to view it.

Actual product comes full screen and in high resolution.

Description

  • Copyright 2012
  • Edition: 1st
  • Downloadable Video
  • ISBN-10: 0-13-275698-6
  • ISBN-13: 978-0-13-275698-3

2+ Hours of Video Instruction

Overview

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

Description

The C# language is more than a decade old, and that maturity means more complexity. This added complexity increases the chances for mistakes and unmaintainable code. Bill regularly presents “C# Puzzlers” at user groups and CodeMash events.  All the “puzzlers” in this LiveLesson have been put to the test with intermediate level developers who tried to break, workaround, and outsmart the code. 

C# Puzzlers exposes common misconceptions that can occur when developers are unclear about how language features interact or lack understanding about how a single features works. Using the fun “Puzzler” format, Bill demonstrates these misconceptions via screencasts using small code samples. He gives you an opportunity to figure it out first, and then explores different ways to modify the code until its behavior is correct.

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

How the Puzzlers work:

1) Each puzzle shows a reasonably small piece of code, and then asks viewers to guess what the code does.

2) You take the opportunity to try and figure it out.

2) Bill then demonstrates what the code does, and why many developers believe it would behave differently.

3) To close out the lesson he discusses how you could write the code differently to accomplish the same result without the misconceptions.

About the Instructor

Bill Wagner has spent his entire career in the software industry, spanning both technical and business roles. Bill’s technical time is spent between curly braces, primarily with C#. He’s the author of the bestselling “Effective C#”, now in its second edition, and “More Effective C#”. His articles have appeared in MSDN Magazine, the C# Developer Center, Visual C++ Developer’s Journal, Visual Studio Magazine, ASP.NET Pro, .NET Developer’s Journal and more. He’s written hundreds of technical articles and actively blogs on technical and business topics.  Bill is also a Microsoft Regional Director.

He spent eight years as a self-employed consultant before co-founding SRT Solutions with Dianne Marsh. Over the past decade, SRT Solutions has grown into a premier software development company, amassing 4 FastTrack awards (2011, 2010, 2008, 2007), the Michigan 50 Companies to Watch award (2011), and making the Inc 500/5000 list (2011 and 2012). Bill was also awarded Automation Alley’s Emerging Technology Leader award in 2011.After a successful exit from SRT Solutions, Bill now spends his time helping developers improve their skills.

Skill Level

This topic should be of interest to anyone developing using the C# language. This includes Windows Server, Windows 8, Windows Phone, MonoDroid, and Mono Touch developers at the following skill level:

Intermediate

Topics Covered

  • Generics
  • Method Resolution
  • Named and Optional Parameters
  • LINQ
  • Value and Reference Semantics
  • Dynamic Programming in C#

Who Should Take This Course

Developers

C# programmers

Course Requirements

Some experience with C# programming.

Table of Contents

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

Lesson 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?

Lesson 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?

Lesson 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?

Lesson 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?

Lesson 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?

Lesson 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?

About LiveLessons Video Training

LiveLessons Video Training series publishes hundreds of hands-on, expert-led video tutorials covering a wide selection of technology topics designed to teach you the skills you need to succeed. This professional and personal technology video series features world-leading author instructors published by your trusted technology brands: Addison-Wesley, Cisco Press, IBM Press, Pearson IT Certification, Prentice Hall, Sams, and Que. Topics include: IT Certification, Programming, Web Development, Mobile Development, Home and Office Technologies, Business and Management, and more.  View all LiveLessons on InformIT at: http://www.informit.com/livelessons

Downloads

Downloads

Get all the downloads for the puzzles and solutions for C# Puzzler’s LiveLesson.

Sample Content

Table of Contents

The introductory Puzzler 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?

Updates

Submit Errata

More Information

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.

Save 35% on Video LiveLessons with coupon VIDEO35