Discover a new way to find and share stories you'll loveā€¦ Learn about Reading Desk

Blog Profile / Fabulous Adventures In Coding


URL :http://blogs.msdn.com/ericlippert/
Filed Under:Programming / Windows Development
Posts on Regator:245
Posts / Week:0.9
Archived Since:August 9, 2009

Blog Post Archive

A new fabulous adventure

Tomorrow, the 30th of November, 2012, is the first day of my fifth decade here on Earth, and my last day at Microsoft. () I've been working at Microsoft full-time since 1996 and had two years of internships before that. Microsoft is an awesome company. Show More Summary

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. I'm occasionally asked why that is. There are a number of reasons; today I'll start with a very specific scenario and then talk about a general philosophy. Show More Summary

It's still essential!

I am pleased to announce that Essential C# 5.0 by Mark Michaelis, and, new for this edition, yours truly, is available for pre-order now. It will be in stores in early December. As long-time readers of this blog know, I was one of the technical editors for Essential C# 4.0 and Essential C# 3.0. Show More Summary

Dynamic contagion, part two

Last time I discussed how "dynamic" tends to spread through a program like a virus: if an expression of dynamic type "touches" another expression then that other expression often also becomes of dynamic type. Today I want to describe...Show More Summary

Dynamic contagion, part one

Suppose you're an epidemiologist modeling the potential spread of a highly infectious disease. The straightforward way to model such a series of unfortunate events is to assume that the population can be divided into three sets: the definitely infected, the definitely healthy, and the possibly infected. Show More Summary

A method group of one

I'm implementing the semantic analysis of dynamic expressions in Roslyn this week, so I'm fielding a lot of questions within the team on the design of the dynamic feature of C# 4. A question I get fairly frequently in this space is as follows: public class Alpha { public int Foo(string x) {... Show More Summary

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 is unhelpful. I don't doubt it. Interestingly, if you rephrased the question as an "and" question, the answer would be the same. What?...Show More Summary

High Altitude

No computer programming stuff today; just some fun for Friday. As I'm writing this Felix Baumgartner's attempt to set the world record for skydiving height by diving from a helium balloon has been scrubbed due to bad weather. This attempt...Show More Summary

Does Not Compute

One of the most basic ways to think about a computer program is that it is a device which takes in integers as inputs and spits out integers as outputs. The C# compiler, for example, takes in source code strings, and those source code strings are essentially nothing more than enormous binary numbers. Show More Summary

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 then a family emergency kept me away from computers from Thursday of last week until just now, and I did not get my article in the queue. Show More Summary

Roslyn September 2012 CTP is now available

I am super excited to announce that we have just released a third "Community Technology Preview" of Roslyn. Roslyn, in case you have not heard, is the code name for the project I work on; we are re-architecting the C# and VB compilers so that they are no longer "black boxes" where code goes in, a miracle happens, and then IL comes out. Show More Summary

Static analysis of "is"

Before I get into the subject of today's fabulous adventure, I want to congratulate the whole rest of Developer Division on the tremendously exciting product that we are formally launching today. (I've done very little actual codingShow More Summary

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, can be a type parameter. That is: void M () { int x = 0; bool b = x is FooBar; // legal, true if FooBar is int. FooBar fb = (FooBar)x; // illegal } or struct FooBar { /... Show More Summary

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 operator": the operator that instructs the compiler to make an explicit conversion from a value of one type to a value of another type. Show More Summary

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 at runtime, even though there is no conversion, implicit or explicit, from x to FooBar allowed by the compiler! That is, FooBar foobar = (FooBar)x; would not be allowed by the compiler in that same program. Show More Summary

Wackiness ensues

No tech today, but this is too funny to not pass along, so consider this your fun for Friday. What would happen if Anders Hejlsberg and Barbara Liskov were forced to share an apartment in an "odd couple" sitcom? () Apparently I'm the "Kramer" of this sitcom. Show More Summary

Out parameters and LINQ do not mix

I am back from my annual vacation in beautiful southwestern Ontario; before I get into the subject of today's post, check out this shot I took with my Windows Phone camera from the plane on the trip home. We are at 37000 feet, just outside...Show More Summary

Should C# warn on null dereference?

As you probably know, the C# compiler does flow analysis on constants for the purposes of finding unreachable code. In this method the statement with the calls is known to be unreachable, and the compiler warns about it. const object...Show More Summary

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 are common, and the rules are pretty complicated. Here's some code I was asked about recently; I've stripped it down to its essenceShow More Summary

The Best Advice I Ever Got

Just a quick link today: The super nice people over at InformIT () are running a series of short articles with the theme "the best advice I ever got", which I think should prove to be an interesting series. They were kind enough to ask...Show More Summary

Copyright © 2011 Regator, LLC