Blog - Title

February, 2011

  • Fabulous Adventures In Coding

    Guidelines and rules for GetHashCode

    • 37 Comments
    " The code is more what you'd call guidelines than actual rules " - truer words were never spoken. It's important when writing code to understand what are vague "guidelines" that should be followed but can be broken or fudged, and what are crisp "rules...
  • Fabulous Adventures In Coding

    Never Say Never, Part Two

    • 25 Comments
    Whether we have a "never" return type or not, we need to be able to determine when the end point of a method is unreachable for error reporting in methods that have non-void return type. The compiler is pretty clever about working that out; it can handle...
  • Fabulous Adventures In Coding

    Never Say Never, Part One

    • 27 Comments
    Can you find a lambda expression that can be implicitly converted to Func<T> for any possible T? . . . . . . . . . . . Hint : The same lambda is convertible to Action as well. . . . . . . . . . Func<int> function = () => { throw new Exception...
  • Fabulous Adventures In Coding

    Looking inside a double

    • 7 Comments
    Occasionally when I'm debugging the compiler or responding to a user question I'll need to quickly take apart the bits of a double-precision floating point number. Doing so is a bit of a pain, so I've whipped up some quick code that takes a double and...
  • Fabulous Adventures In Coding

    What would Feynman do?

    • 73 Comments
    No one I know at Microsoft asks those godawful "lateral-thinking puzzle" interview questions anymore. Maybe someone still does, I don't know. But rumour has it that a lot of companies are still following the Microsoft lead from the 1990s in their interviews...
  • Fabulous Adventures In Coding

    Optional arguments on both ends

    • 23 Comments
    Before we get into today's topic, a quick update on my posting from last year about Roslyn jobs. We have gotten a lot of good leads and made some hires but we still have positions open, both on the Roslyn team and on the larger Visual Studio team. For...
  • Fabulous Adventures In Coding

    Strange, but legal

    • 19 Comments
    "Can a property or method really be marked as both abstract and override?" one of my coworkers just asked me. My initial gut response was "of course not!" but as it turns out, the Roslyn codebase itself has a property getter marked as both abstract and...
  • Fabulous Adventures In Coding

    Curiouser and curiouser

    • 24 Comments
    Here's a pattern you see all the time in C#: class Frob : IComparable<Frob> At first glance you might ask yourself why this is not a "circular" definition; after all, you're not allowed to say " class Frob : Frob "(*). However, upon deeper reflection...
Page 1 of 1 (8 items)