Noda Time v1.0 released

Go get Noda Time 1.0! NuGet package (and the testing package) Project home page Project downloads page v1.0 user guide v1.0 API reference Today is the end of the longest release cycle I’ve been personally involved in. On November 5th 2009, I announced my intention to write a port of Joda Time for .NET. The next day, Noda Time was born – with a lofty (foolhardy) set of targets. Near the end of a talk *about* Noda Time this evening, I released Noda Time 1.0.0. It’s taken three years, but I’m immensely proud of what we’ve managed to achieve. We’re … Continue reading Noda Time v1.0 released

How can I enumerate thee? Let me count the ways…

This weekend, I was writing some demo code for the async chapter of C# in Depth – the idea was to decompile a simple asynchronous method and see what happened. I received quite a surprise during this, in a way which had nothing to do with asynchrony. Given that at execution time, text refers to an instance of System.String, and assuming nothing in the body of the loop captures the ch variable, how would you expect the following loop to be compiled? foreach (char ch in text) {     // Body here } Before today, I could think of four … Continue reading How can I enumerate thee? Let me count the ways…

Stack Overflow and personal emails

This post is partly meant to be a general announcement, and partly meant to be something I can point people at in the future (rather than writing a short version of this on each email). These days, I get at least a few emails practically every day along the lines of: "I saw you on Stack Overflow, and would like you to answer this development question for me…" It’s clear that the author: Is aware of Stack Overflow Is aware that Stack Overflow is a site for development Q&A Is aware that I answer questions on Stack Overflow … and … Continue reading Stack Overflow and personal emails

The future of "C# in Depth"

I’m getting fairly frequent questions – mostly on Twitter – about whether there’s going to be a third edition of C# in Depth. I figure it’s worth answering it once in some detail rather than repeatedly in 140 characters 😉 I’m currently writing a couple of new chapters covering the new features in C# 5 – primarily async, of course. The current "plan" is that these will be added to the existing 2nd edition to create a 3rd edition. There will be minimal changes to the existing text of the 2nd edition – basically going over the errata and editing … Continue reading The future of "C# in Depth"

The perils of conditional mutability

This morning I was wrestling with trying to make some Noda Time unit tests faster. For some reason, the continuous integration host we’re using is really slow at loading resources under .NET 4. The unit tests which run in 10 seconds on my home laptop take over three hours on the continuous integration system. Taking stack traces at regular intervals showed the problem was with the NodaFormatInfo constructor, which reads some resources. I may look into streamlining the resource access later, but before we get to that point, I wanted to try to reduce the number of times we call … Continue reading The perils of conditional mutability

More fun with DateTime

(Note that this is deliberately not posted in the Noda Time blog. I reckon it’s of wider interest from a design perspective, and I won’t be posting any of the equivalent Noda Time code. I’ll just say now that we don’t have this sort of craziness in Noda Time, and leave it at that…) A few weeks ago, I was answering a Stack Overflow question when I noticed an operation around dates and times which should have been losing information apparently not doing so. I investigated further, and discovered some "interesting" aspects of both DateTime and TimeZoneInfo. In an effort … Continue reading More fun with DateTime

Type initializer circular dependencies

To some readers, the title of this post may induce nightmarish recollections of late-night debugging sessions. To others it may be simply the epitome of jargon. Just to break the jargon down a bit: Type initializer: the code executed to initialize the static variables of a class, and the static constructor Circular dependency: two bits of code which depend on each other – in this case, two classes whose type initializers each require that the other class is initialized A quick example of the kind of problem I’m talking about would be helpful here. What would you expect this code … Continue reading Type initializer circular dependencies

Diagnosing weird problems – a Stack Overflow case study

Earlier, I came across this Stack Overflow question. I solved it, tweeted it, but then thought it would serve as a useful case study into the mental processes I go through when trying to solve a problem – whether that’s on Stack Overflow, at work, or at home. It’s definitely worth reading the original question, but the executive summary is: When I compute the checksum/hash of c:\Windows\System32\Calc.exe using various tools and algorithms, those tools all give the same answer for each algorithm. When I try doing the same thing in Java, I get different results. What’s going on? Now to … Continue reading Diagnosing weird problems – a Stack Overflow case study

Eduasync 20: Changes between the VS11 Preview and the Visual Studio 11 Beta

A while I ago I blogged about what had changed under the hood of async between the CTP and the VS11 Preview. Well, now that the VS11 Beta is out, it’s time to do it all again… Note that the code in this post is in the Eduasync codebase, under a different solution (Eduasync VS11.sln). Many of the old existing projects won’t compile with VS11 beta, but I’d rather leave them as they are for posterity, showing the evolution of the feature. Stephen Toub has an excellent blog post covering some of this, so while I’ll mention things he’s covered, … Continue reading Eduasync 20: Changes between the VS11 Preview and the Visual Studio 11 Beta

Subtleties in API design – member placement

Noda Time is nearing v1.0, which means I’m spending more time writing documentation than code. It also means reviewing the APIs we’ve got with a critical eye – whether that’s removing extraneous members, adding useful ones, or moving things around. (In particular, writing documentation often suggests where a change would make calling code read more naturally.) This post is about one particular section of the API, and the choices available. Although I do go into some detail around the specific calls involved, that’s just for context… the underlying choices are ones which could be faced when designing any API. I’ve … Continue reading Subtleties in API design – member placement