Funniest Hungarian Joke Ever

I’m back from my fabulous adventures in Austria, Romania and Canada and I had a fabulous time, as you might imagine. We were in Romania for a wedding of some close personal friends who live here in Seattle; much of the groom’s family escaped from Romania during the Communist period and settled in Austria, so…

21

I’m glad and sad that that’s over

No computers; high technology of a different sort today. Shuttle Atlantis has safely returned to earth for the last time; the Space Shuttle Program is over. Which both makes me sad, and makes me breathe a huge sigh of relief. Thank goodness that is finally over. As you might have gathered, I am highly ambivalent…

12

Strings, immutability and persistence

Todays post is based on a question from StackOverflow; I liked it so much I figured hey, let’s just blog it today. When you look at a string in C#, it looks to you like a collection of characters, end of story. But of course, behind the scenes there is a data structure in memory…

32

The curious property revealed

Today is the fifteenth anniversary of my first day of full time work here at Microsoft. Hard to believe it has been a decade and a half of writing developer tools. I am tremendously fortunate to be able to work with such a great team on such a great toolset for such great customers. I’m…

17

What curious property does this string have?

There are all kinds of interesting things in the Unicode standard. For example, the block of characters from U+A000 to U+A48F is for representing syllables in the “Yi script”. Apparently it is a Chinese language writing system developed during the Tang Dynasty. A string drawn from this block has an unusual property; the string consists…

33

My Buddy Neil Totally Agrees With Me

[No computer stuff today; just some fun for a Friday.] British fantasy author Neil Gaiman was in Seattle recently. I was so disappointed that I did not find out about it until it was too late to attend his event. It’s a pity I missed it because I’ve been wanting for years to ask Neil…

12

Following the pattern

Here’s a question I got from a user recently: The foreach loop in C# uses a pattern-based approach to semantic analysis. LINQ in C# also uses a pattern-based approach. Why don’t other features, such as the “using” statement, also use a pattern-based approach? What a great question! First off, what do we mean by a…

8

Ref returns and ref locals

“Ref returns” are the subject of another great question from StackOverflow that I thought I might share with a larger audience. Ever since C# 1.0 you’ve been able to create an “alias” to a variable by passing a “ref to a variable” to certain methods: static void M(ref int x){    x = 123;}…int y =…

60

Atomicity, volatility and immutability are different, part three

So what does “volatile” mean, anyway? Misinformation abounds on this subject. First off, so as to not bury the lead: in C# the rules have been carefully designed so that every volatile field read and write is also atomic. (Of course the converse does not follow; it is perfectly legal for an operation to be…

18

Atomicity, volatility and immutability are different, part two

Last time we established that an “atomic” read or write of a variable means that in multithreaded scenarios, you never end up with “halfway mutated” values in the variable. The variable goes from unmutated to mutated directly, with no intervening state. I also talked a bit about how making fields of a struct “readonly” has…

8