Blog - Title

  • Fabulous Adventures In Coding

    A new fabulous adventure

    • 48 Comments
    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...
  • Fabulous Adventures In Coding

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

    • 10 Comments
    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...
  • Fabulous Adventures In Coding

    It's still essential!

    • 3 Comments
    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...
  • Fabulous Adventures In Coding

    Dynamic contagion, part two

    • 2 Comments
    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 one of the least...
  • Fabulous Adventures In Coding

    Dynamic contagion, part one

    • 9 Comments
    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...
  • Fabulous Adventures In Coding

    A method group of one

    • 8 Comments
    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...
  • Fabulous Adventures In Coding

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

    • 36 Comments
    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?...
  • Fabulous Adventures In Coding

    High Altitude

    • 3 Comments
    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 has got me...
  • Fabulous Adventures In Coding

    Does Not Compute

    • 11 Comments
    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...
  • Fabulous Adventures In Coding

    How do we ensure that method type inference terminates?

    • 8 Comments
    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. Suffice to say...
  • Fabulous Adventures In Coding

    Roslyn September 2012 CTP is now available

    • 9 Comments
    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...
  • Fabulous Adventures In Coding

    Static analysis of "is"

    • 5 Comments
    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 coding on Visual Studio...
  • Fabulous Adventures In Coding

    An "is" operator puzzle, part two

    • 13 Comments
    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<FooBar>() { int x = 0; bool b = x is FooBar; // legal, true if FooBar is int. FooBar fb = (FooBar)x; /...
  • Fabulous Adventures In Coding

    Fabulous Adventures In Casting

    • 3 Comments
    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. I have recently...
  • Fabulous Adventures In Coding

    An "is" operator puzzle, part one

    • 21 Comments
    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...
  • Fabulous Adventures In Coding

    Wackiness ensues

    • 8 Comments
    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...
  • Fabulous Adventures In Coding

    Out parameters and LINQ do not mix

    • 28 Comments
    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 of Billings...
  • Fabulous Adventures In Coding

    Should C# warn on null dereference?

    • 35 Comments
    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 x = null; void Foo...
  • Fabulous Adventures In Coding

    When is a cast not a cast?

    • 26 Comments
    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 essence for clarity: class...
  • Fabulous Adventures In Coding

    The Best Advice I Ever Got

    • 11 Comments
    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 me to give an...
  • Fabulous Adventures In Coding

    Foolish consistency is foolish

    • 29 Comments
    Once again today's posting is presented as a dialogue, as is my wont. Why is var sometimes required on an implicitly-typed local variable and sometimes illegal on an implicitly typed local variable? That's a good question but can you make it more precise...
  • Fabulous Adventures In Coding

    Eric Rambles On About C#, Again

    • 8 Comments
    Rachel Roumeliotis, who amongst other things edits C# books for O'Reilly, recently did an interview with me where I ramble on about async/await, Roslyn, performance analysis as an engineering discipline, and some broad-strokes ideas for future language...
  • Fabulous Adventures In Coding

    Implementation-defined behaviour

    • 12 Comments
    As I've mentioned several times on this blog before , C# has been carefully designed to eliminate some of the "undefined behaviour" and "implementation-defined behaviour" that you see in languages like C and C++. But I'm getting ahead of myself; I should...
  • Fabulous Adventures In Coding

    Persistence, Facades and Roslyn's Red-Green Trees

    • 23 Comments
    We decided early in the Roslyn design process that the primary data structure that developers would use when analyzing code via Roslyn is the syntax tree . And thus one of the hardest parts of the early Roslyn design was figuring out how we were going...
  • Fabulous Adventures In Coding

    Announcing Microsoft Roslyn June 2012 CTP

    • 10 Comments
    Good afternoon all, I am happy to announce that we are releasing a second Community Technology Preview release of Roslyn, the project I actually work on, today. I am super excited! So, let's cut to the chase. Key facts: Roslyn is a library of code analysis...
Page 1 of 32 (783 items) 12345»