Fabulous Adventures In Coding

Eric Lippert's Erstwhile Blog

Why is deriving a public class from an internal class illegal?

In C# it is illegal to declare a class D whose base class B is in any way less accessible than D....

Date: 11/13/2012

It's still essential!

I am pleased to announce that Essential C# 5.0 by Mark Michaelis, and, new for this edition, yours...

Date: 11/09/2012

Dynamic contagion, part two

Last time I discussed how "dynamic" tends to spread through a program like a virus: if an expression...

Date: 11/08/2012

A method group of one

I'm implementing the semantic analysis of dynamic expressions in Roslyn this week, so I'm fielding a...

Date: 10/22/2012

Is C# a strongly typed or a weakly typed language?

Presented as a dialogue, as is my wont! Is C# a strongly typed or a weakly typed language? Yes. That...

Date: 10/15/2012

Does Not Compute

One of the most basic ways to think about a computer program is that it is a device which takes in...

Date: 10/10/2012

How do we ensure that method type inference terminates?

I missed the party. I was all set to be on that massive wave of announcements about TypeScript, and...

Date: 10/02/2012

Roslyn September 2012 CTP is now available

I am super excited to announce that we have just released a third "Community Technology Preview" of...

Date: 09/17/2012

Static analysis of "is"

Before I get into the subject of today's fabulous adventure, I want to congratulate the whole rest...

Date: 09/12/2012

An "is" operator puzzle, part two

As I said last time, that was a pretty easy puzzle: either FooBar, or the type of local variable x,...

Date: 08/27/2012

Fabulous Adventures In Casting

I've written a lot about casting over the years in this blog, but always in the context of the "cast...

Date: 08/27/2012

An "is" operator puzzle, part one

It is possible for a program with some local variable x: bool b = x is FooBar; to assign true to b...

Date: 08/23/2012

Wackiness ensues

No tech today, but this is too funny to not pass along, so consider this your fun for Friday. What...

Date: 08/17/2012

Should C# warn on null dereference?

As you probably know, the C# compiler does flow analysis on constants for the purposes of finding...

Date: 07/17/2012

When is a cast not a cast?

I'm asked a lot of questions about conversion logic in C#, which is not that surprising. Conversions...

Date: 07/10/2012

The Best Advice I Ever Got

Just a quick link today: The super nice people over at InformIT (*) are running a series of short...

Date: 06/27/2012

Foolish consistency is foolish

Once again today's posting is presented as a dialogue, as is my wont. Why is var sometimes required...

Date: 06/25/2012

Eric Rambles On About C#, Again

Rachel Roumeliotis, who amongst other things edits C# books for O'Reilly, recently did an interview...

Date: 06/21/2012

Implementation-defined behaviour

As I've mentioned several times on this blog before, C# has been carefully designed to eliminate...

Date: 06/18/2012

Persistence, Facades and Roslyn's Red-Green Trees

We decided early in the Roslyn design process that the primary data structure that developers would...

Date: 06/08/2012

Announcing Microsoft Roslyn June 2012 CTP

Good afternoon all, I am happy to announce that we are releasing a second Community Technology...

Date: 06/05/2012

GUID guide, part three

Let's recap: a GUID is a 128 bit integer that is used as a globally unique identifier. GUIDs are not...

Date: 05/07/2012

GUID guide, part two

So how is it that a GUID can be guaranteed to be unique without some sort of central authority that...

Date: 04/30/2012

null is not false, part three

Returning now to the subject at hand: we would like to allow user-defined "overloads" of the &...

Date: 04/19/2012

A brief digression

Before we continue our exploration of truthiness in C#, a brief digression. I mentioned last time...

Date: 04/17/2012

null is not false, part two

In Raymond Smullyan's delightful books about the Island of Knights and Knaves -- where, you'll...

Date: 04/12/2012

null is not false

The way you typically represent a "missing" or "invalid" value in C# is to use the "null" value of...

Date: 03/26/2012

Why not automatically infer constraints?

UPDATE: Whoops! I accidentally set a draft of this article to automatically publish on a day that I...

Date: 03/09/2012

Why are local variables definitely assigned in unreachable statements?

You're probably all familiar with the feature of C# which disallows reading from a local variable...

Date: 03/05/2012

The C# 5.0 beta release is now available

I am super excited to announce that the beta release of Visual Studio version 11 (which includes the...

Date: 02/29/2012

The Solution To The Simple Puzzle

The first time I ran my histogram visualizer I asked for a Cauchy distribution with a minimum of -10...

Date: 02/27/2012

A Simple Puzzle

My original version of the histogram-generating code that I whipped up for the previous episode of...

Date: 02/24/2012

Generating Random Non-Uniform Data In C#

When building simulations of real-world phenomena, or when generating test data for algorithms that...

Date: 02/21/2012

Bad Metaphors

The standard way to teach beginner OO programmers about classes is to make a metaphor to the real...

Date: 02/13/2012

What is "binding" and what makes it late?

"Late binding" is one of those computer-sciency terms that, like "strong typing", means different...

Date: 02/06/2012

Anonymous Types Unify Within An Assembly, Part Two

Last time I noted that any two usages of "the same" anonymous type within an assembly actually unify...

Date: 01/30/2012

Anonymous types unify within an assembly, Part One

Back in my last post of 2010 I said that I would do an example of anonymous types unifying within an...

Date: 01/23/2012

What is the defining characteristic of a local variable?

If you ask a dozen C# developers what a "local variable" is, you might get a dozen different...

Date: 01/16/2012

Every public change is a breaking change

Here's an inconvenient truth: just about every "public surface area" change you make to your code is...

Date: 01/09/2012

He's So Dreamy

Happy New Year all! It has just been brought to my attention that this blog and the Programmer Ryan...

Date: 01/02/2012

Shadowcasting in C#, Part Six

OK, let's finish up this year and this series. We have an algorithm that can compute what cells in...

Date: 12/29/2011

Shadowcasting in C#, Part Five

I hope you all had a pleasant Christmas and Boxing Day; we chose to not travel to see family this...

Date: 12/27/2011

Shadowcasting in C#, Part Four

Last time we saw how many different ways there were to get the calculation of the top cell based on...

Date: 12/22/2011

Next>