~/devreads

Jon Skeet

https://codeblog.jonskeet.uk/ · 110 posts · history since 2013 · active

18 Jan

jonskeet 7 min read

I’ve now been through three approaches to load testing for the site, and I think I’ve settled on a solution for the medium term at least. This post explains what I’m trying to achieve, along with the pros and cons of what I’ve tried. Requirements For this particular site, I have four requirements: If the … Continue reading Election 2029:…

election 2029

17 Jan

jonskeet 4 min read

On January 15th 2026, Robert Jenrick broke my election site. Okay, that’s slightly hyperbolic. The site continued to operate, and it would be fairer to say that the actions of Kemi Badenoch and Robert Jenrick exposed a flaw in the data modelling in my site. For those readers who don’t follow UK politics, two events … Continue reading Election 2029:…

election 2029

31 Dec 2025

jonskeet 6 min read

As I’ve written before, I’m leaning heavily into immutability in the election site code. Until September 2025 (it’s taken a long time to get round to writing this blog post) that meant a combination of records, ImmutableList<T> and ImmutableDictionary<TKey, TValue>. In an ECMA C# standards meeting, however, Joseph Musser passed on some really valuable feedback … Continue reading Changing Immutable…

c#election 2029

29 Jul 2025

jonskeet 8 min read

In my previous blog post I described some behaviour of C# record types which was unexpected to me, though entirely correct according to the documentation. This is a follow-up post to that one, so if you haven’t read that one yet, please do so – I won’t go over all the same ground. Is this … Continue reading Records and…

c#election 2029

19 Jul 2025

jonskeet 7 min read

Unexpected inconsistency in records The other day, I was trying to figure out a bug in my code, and it turned out to be a misunderstanding on my part as to how C# records work. It’s entirely possible that I’m the only one who expected them to work in the way that I did, but … Continue reading Unexpected inconsistency…

c#

13 Apr 2025

jonskeet 10 min read

Postcodes After a pretty practical previous post about records and collections, this post is less likely to give anyone ideas about how they might tackle a problem in their own project, and doesn’t have any feature requests for Microsoft either. It’s an area I’ve found really fun though. An introduction to postcodes in the UK … Continue reading Election 2029:…

c#election 2029

27 Mar 2025

jonskeet 10 min read

Records and Collections This post is to some extent a grab-bag of points of friction I’ve encountered when using records and collections within the election site. Records recap This may end up being the most generally useful blog post in this series. Although records have been in C# since version 10, I haven’t used them … Continue reading Records and…

c#election 2029

jonskeet 12 min read

Storage Since my last post about the data models, I’ve simplified things very slightly – basically the improvements that I thought about while writing the post have now been implemented. I won’t go into the details of the changes, as they’re not really important, but that’s just to explain why some examples might look like … Continue reading Election 2029:…

election 2029

16 Mar 2025

jonskeet 10 min read

Data models (and view-models) and how they’re used I was considering using the term “architecture” somewhere in the title of this post, but it feels too pompous for the scale of site. I could probably justify it, but it would give me the ick every time I used the term. But this post will basically … Continue reading Election 2029:…

election 2029

10 Mar 2025

jonskeet 5 min read

Technical overview This post is mostly for scene-setting purposes. There’s nothing particularly remarkable here, but it’s useful to get the plain facts out of the way before we get into genuinely interesting design aspects. Just as a reminder, go to https://election2029.uk if you want to see what any of this looks like at the moment. … Continue reading Election 2029:…

election 2029

jonskeet 4 min read

Introduction It’s been over 8 months since I started my UK Election 2029 site, and high time that I actually wrote an introduction post so that I can get into more detailed topics later. In 2024, shortly after the UK general election was announced, I created a small site at https://jonskeet.uk/election2024, initially to keep track … Continue reading Election 2029:…

election 2029

8 Feb 2025

jonskeet 3 min read

Shortly after writing my previous post, a colleague pinged me to say she’d figured out what was wrong – at least at the most immediate level, i.e. the exception itself. Nothing is wrong with the ordering code – it’s just that the exception message is too easy to misread. She’s absolutely right, and I’m kicking … Continue reading Election 2029:…

diagnosticselection 2029

7 Feb 2025

jonskeet 7 min read

I really thought I’d already written a first blog post about my Election 2029 site (https://election2029.uk) but I appear to be further behind on my blogging than I’d thought. This is therefore a little odd first post in the series, but never mind. To some extent it isn’t particularly related to the election site, except … Continue reading Election 2029:…

diagnosticselection 2029

11 Nov 2024

jonskeet 10 min read

When I wrote my preview DigiMixer post, I was awaiting the arrival of my latest mixer: a Behringer Wing Rack. It arrived a few days later, and I’m pleased to say it didn’t take long to integrate it with DigiMixer. (It’s now my main mixer.) While most of the integration was smooth sailing, there’s one … Continue reading When Abstractions…

digimixer

22 Oct 2024

jonskeet 4 min read

It’s entirely possible that I’ve posted something on this topic before. I know I’ve posted about it on social media before. Every so often – thankfully not too often – I see a post on Stack Overflow containing something like this: “This looks like a bug in VS.NET” “I’m 100% sure my code is correct” … Continue reading No, the…

diagnostics

jonskeet 11 min read

Finally, several posts in, I’m actually going to start talking about abstraction using DigiMixer as the core example. When I started writing DigiMixer (almost exactly two years ago) I didn’t expect to take so long to get to this point. Even now, I’m not expecting this post to cover “everything about abstraction” or even “all … Continue reading Abstraction: Introduction…

digimixer

9 Jul 2024

jonskeet 14 min read

Introduction On Thursday (July 4th, 2024) the UK held a general election. There are many, many blog posts, newspaper articles, podcast episodes etc covering the politics of it, and the lessons that the various political parties may need to learn. I, on the other hand, learned very different lessons on the night of the 4th … Continue reading Lessons from…

c#general

23 Jun 2024

jonskeet 9 min read

Introduction I don’t know much about my blog readership, so let’s start off with two facts that you may not be aware of: I live in the UK. The UK has a general election on July 4th 2024. I’m politically engaged, and this is a particularly interesting election. The Conservative party have been in office … Continue reading Building an…

c#

18 Jan 2024

jonskeet 4 min read

This wasn’t the post I’d expected to write, but after reading two comments in close succession on an old post when I first started playing with the X-Touch Mini I decided to spend some time effectively shuffling code around (and adding a primitive configuration dialog) so I could publish a standalone app for DigiMixer. I … Continue reading DigiMixer –…

digimixer

2 Jan 2024

jonskeet 16 min read

Despite this blog series going very slowly, the DigiMixer project itself has certainly not been stalled. Over the last year, I’ve added support for various additional mixers, as well as improving the support for some of the earlier ones, and performing quite a lot of refactoring. DigiMixer now supports the following mixers, to a greater … Continue reading DigiMixer: Protocols…

digimixer

25 Nov 2023

jonskeet 4 min read

Nearly three years ago, I posted about some fun I’d been having with VISCA using C#. As a reminder, VISCA is a camera control protocol, originally used over dedicated serial ports, but more recently over IP. Until this week, all the cameras I’d worked with were very similar – PTZOptics, Minrray and ZowieTek all produce … Continue reading Variations in…

c#

11 Jun 2023

jonskeet 2 min read

I’m aware that I haven’t been writing as many blog posts as I’d hoped to about DigiMixer. I expect the next big post to be a comparison of the various protocols that DigiMixer supports. (I’ve started a protocols directory in the GitHub repo, but there isn’t much there yet.) In the meantime, I wanted to … Continue reading SSC Protocol…

digimixer

14 Jan 2023

jonskeet 15 min read

While I’m expecting this blog post series to cover a number of topics, the primary purpose is as a vehicle for discussing abstraction and what it can look like in real-world projects instead of the “toy” examples that are often shown in books and articles. While the DigiMixer project itself is still in some senses … Continue reading DigiMixer: Introduction…

digimixer

30 Oct 2022

jonskeet 9 min read

This morning (October 30th 2022), the clocks went back in the UK – the time that would have been 2am fell back to 1am. This is just the regular “fall back” transition – there’s nothing special about it. As it happens, I’d driven my electric car for quite a long journey yesterday, so I had … Continue reading Handling times…

generalnoda time

16 Oct 2022

jonskeet 6 min read

This is the first of what I expect to become a series of maybe a dozen blog posts about a hobby project I’ve started, called DigiMixer. Back in January 2021 I posted about controlling an XR-16 using Open Sound Control, and then later using an X-Touch Mini to control the XR-16 using the same underlying … Continue reading Introduction to…

digimixer

16 Apr 2022

jonskeet 17 min read

I’ve been keeping an eye on MAUI – the .NET Multi-platform App UI – for a while, but I’ve only recently actually given it a try. MAUI is essentially the evolution of Xamarin.Forms, embracing WinUI 3 and expanding from a mobile focus to desktop apps as well. It’s still in preview at the time of … Continue reading Taking .NET…

c#

27 Mar 2022

jonskeet 23 min read

In part 1, we ended up with a lot of test data specified in a text file, but without working tests – and with a conundrum as to how we’d test the .NET Core 3.1 data which requires additional information about the “hidden” AdjustmentRule.BaseUtcOffsetDelta property. As with the previous blog post, this one is fairly … Continue reading What’s up…

c#noda time

20 Feb 2022

jonskeet 8 min read

As part of my church A/V system (At Your Service), I run a separate local web server to interact with the Zoom SDK. Initially this was because the Zoom SDK would only run in 32-bit processes and I needed a 64-bit process to handle the memory requirements for the rest of the app. However, it’s … Continue reading Diagnosing an…

c#diagnostics

jonskeet 4 min read

In the course of my work on our local church A/V system, I’ve spent quite a lot of time playing with Elgato Stream Decks and NDI cameras. It only occurred to me a week or so ago that it would be fun to combine them. The Stream Deck screens are remarkably capable – they’re 96×96 … Continue reading Displaying NDI…

c#wacky ideas

17 Feb 2022

jonskeet 8 min read

As I have mentioned before, I’ve been spending a lot of time over the last two years writing code for my local church’s A/V system. (Indeed, I’ve been giving quite a few user group talks recently about the fun I’ve had doing so.) That new A/V system is called “At Your Service”, or AYS for … Continue reading Diagnosing a…

c#diagnostics

5 Feb 2022

jonskeet 33 min read

.NET 6 was released in November 2021, and includes two new types which are of interest to date/time folks: DateOnly and TimeOnly. (Please don’t add comments saying you don’t like the names.) We want to support these types in Noda Time, with conversions between DateOnly and LocalDate, and TimeOnly and LocalTime. To do so, we’ll … Continue reading What’s up…

c#noda time

14 Jul 2021

jonskeet 1 min read

Just a quick post with some updates around books and related events… Software Mistakes and Tradeoffs: MEAP update In June, I posted about the book that Tomasz Lelek and I are writing. (Well, Tomasz is doing the bulk of the work – only two of the thirteen chapters are by me, but I’ll take any … Continue reading Book updates…

books

11 Jun 2021

jonskeet 2 min read

I’m delighted to announce that I’ve been hard at work contributing to a new book. The book is called “Software Mistakes and Tradeoffs: How to make good programming decisions” and the principal author is Tomasz Lelek. The book was Tomasz’s idea, and he’s written the vast majority of the material, but I’ve contributed a chapter … Continue reading New book:…

books

28 Mar 2021

jonskeet 11 min read

Background As I wrote in my earlier blog post about using OSC to control a Behringer XR16, I’m working on code to make our A/V system at church much easier to work with. From an audio side, I’ve effectively accomplished two goals already: Remove the intimidating hardware mixer with about 150 physical knobs/buttons Allow software … Continue reading Playing with…

c#

27 Jan 2021

jonskeet 5 min read

In some senses, this is a follow on from my post on VISCA camera control in C#. It’s about another piece of hardware I’ve bought for my local church, and which I want to control via software. This time, it’s an audio mixer. Audio mixers: from hardware controls to software controls The audio mixer we’ve … Continue reading OSC mixer…

c#

4 Dec 2020

jonskeet 3 min read

During lockdown, I’ve been doing quite a lot of tech work for my local church… mostly acting in a sort of “producer” role for our Zoom services, but also working out how we can enable “hybrid” services when some of us are back in our church buildings, with others still at home. (This is partly … Continue reading VISCA camera…

c#

23 Oct 2020

jonskeet 26 min read

Note: all the code in this blog post is available in my DemoCode GitHub repo, under Functions. For most of 2020, one of the projects I’ve been working on is the .NET Functions Framework. This is the .NET implementation of the Functions Framework Contract… but more importantly to most readers, it’s “the way to run … Continue reading A Tour…

c#

29 Aug 2020

jonskeet 9 min read

History I started blogging back in 2005, shortly before attending the only MVP summit I’ve managed to go to. I hosted the blog on msmvps.com, back when that was a thing. In 2014 I migrated to wordpress.com, in the hope that this would make everything nice and simple: it’s a managed service, dedicated to blogging, … Continue reading Posting to…

c#general

19 Jul 2020

jonskeet 8 min read

This is a blog post rather than a bug report, partly because I really don’t know what’s at fault. Others with more knowledge of how the console works in .NET Core, or exactly what the Travis log does, might be able to dig deeper. TL;DR: If you’re running jobs using .NET Core 3.1 on Travis … Continue reading Travis logs…

c#diagnosticsgeneral

12 Jul 2020

jonskeet 28 min read

Blazor and the Web MIDI API Friday, 9pm Yesterday, speaking to the NE:Tech user group about V-Drum Explorer, someone mentioned the Web MIDI API– a way of accessing local MIDI devices from a browser. Now my grasp of JavaScript is tenuous at best… but that’s okay, because I can write C# using Blazor. So in … Continue reading V-Drum Explorer:…

v-drums

3 Mar 2020

jonskeet 3 min read

My current clunky “put all the code in the view” approach to V-Drum Explorer is creaking at the seams. I’m really not a WPF developer, and my understanding of MVVM is more theoretical than practical. I’ve read a reasonable amount, but quite a lot of aspects of V-Drum Explorer don’t really fit with the patterns … Continue reading V-Drum Explorer:…

v-drums

25 Feb 2020

jonskeet 6 min read

So, just to recap, I’m writing an explorer for my Roland V-Drums set (currently a TD-17, but with a TD-27 upgrade on the way, excitingly). This involves copying configuration data from the module (the main bit of electronics involved) into the application, displaying with it, editing it, then copying it back again so that I … Continue reading V-Drum Explorer:…

v-drums

21 Feb 2020

jonskeet 2 min read

It’s amazing how sometimes small changes can make you very happy. This week I was looking at how DragonFruit does its entry point magic, and realized I had a great use case for the same kind of thing. Some of my oldest code that’s still in regular use is ApplicationChooser – a simple tool for … Continue reading New and…

c#speaking engagements

25 Nov 2019

jonskeet 1 min read

I’ve been immensely privileged to be invited to speak at various international developer conferences, and until now I’ve usually tried to accept the majority of those invitations. I’ve had a wonderful time, and made many dear friends – who I’ve often then caught up with at other events. However, I’ve recently found that travelling has … Continue reading Reducing my…

speaking engagements

11 Nov 2019

jonskeet 5 min read

If this is the first blog post about V-Drum Explorer you’ve read, see the first post in this series for the background. In this post we’ll look at the MIDI interface I use in V-Drum Explorer to send and receive configuration information. MIDI basics (Apologies to anyone who really knows their stuff about MIDI – … Continue reading V-Drum Explorer:…

v-drums

31 Oct 2019

jonskeet 4 min read

This is the first in what I expect to be quite a long series of blog posts, meandering over a fairly wide range of topics as they crop up. There’s nothing particularly technical in this introductory post. It’s really just a starting point. V-Drums In July 2019, inspired/encouraged by a friend name Alice, I bought … Continue reading V-Drum Explorer:…

v-drums

25 Oct 2019

jonskeet 12 min read

This post revisits the problem described in Versioning Limitations in .NET, based on reactions to that post and a Twitter discussion which occurred later. Before getting onto the main topic of the post, I wanted to comment a little on that Twitter discussion. I personally found it frustrating at times, and let that frustration leak … Continue reading Options for…

versioning

20 Oct 2019

jonskeet 2 min read

(I’m writing this post primarily so I can link to it in an internal document on Monday. There’s nothing sensitive or confidential here, so I might as well get it down in a blog post.) SemVer is pretty clear about pre-releases. Any version with a major version of 0 is considered “initial development”, and anything … Continue reading Why I…

versioning

12 Oct 2019

jonskeet 1 min read

Update: I don’t know whether it was partially due to this blog post or not, but AppVeyor has fixed things so that you don’t (currently, 20th October 2019) need to use the fix in this post. You may want to include it anyway, for the sake of future-proofing. TL;DR: If your AppVeyor build starts breaking … Continue reading Using “git…

diagnosticsgeneralnoda time

30 Jun 2019

jonskeet 16 min read

This is a blog post I’ve intended to write for a very long time. (Other blog posts in that category include a recipe for tiramisu ice cream, and “knights and allies”.) It’s one of those things that’s grown in my mind over time, becoming harder and harder to start. However, there have been three recent … Continue reading Versioning limitations…

c#designversioning

25 May 2019

jonskeet 3 min read

This morning I tweeted this: Just found a C# 8 nullable reference types warning in Noda Time. Fixing it by changing Foo(x, x?.Bar) to Foo(x, x?.Bar!) which looks really dodgy… anyone want to guess why it’s okay? This attracted more interest than I expected, so I thought I’d blog about it. First let’s unpack what … Continue reading Lying to…

c#c# 8evil code

27 Mar 2019

jonskeet 17 min read

Note: this is a pretty long post. If you’re not interested in the details, the conclusion at the bottom is intended to be read in a standalone fashion. There’s also a related blog post by Lau Taarnskov – if you find this one difficult to read for whatever reason, maybe give that a try. When … Continue reading Storing UTC…

generalnoda time

17 Mar 2019

jonskeet 12 min read

Side-note: this may be one of the clumsiest titles I’ve ever written for a blog post. But it does what it says on the tin. Oh, and the space after “ASP” in “ASP .NET Core” everywhere it to avoid auto-linking. While I could use a different dot or a zero-width non-breaking space to avoid it, … Continue reading Hosting ASP.NET…

diagnosticsgooglenoda time

10 Feb 2019

jonskeet 7 min read

Background: Noda Time and C# 8 Note: this blog post was written based on experimentation with Visual Studio 2019 preview 2.2. It’s possible that some of the details here will change over time. C# 8 is nearly here. At least, it’s close enough to being “here” that there are preview builds of Visual Studio 2019 … Continue reading NullableAttribute and…

c#c# 8noda time

19 Sept 2018

jonskeet 1 min read

This is more of a quick, explanatory “heads-up” post than anything else. On March 31st 2018, I started an experiment: I created a new Stack Overflow user called “Daisy Shipton” with no picture and a profile that just read “Love coding in C#” (or similar). I wanted to see how a new user presenting with … Continue reading Farewell, Daisy…

stack overflow

21 Apr 2018

jonskeet 8 min read

This blog post is effectively a log of my experience with the preview of the C# 8 nullable reference types feature. There are lots of caveats here: it’s mostly “as I go along” so there may well be backtracking. I’m not advising the right thing to do, as I’m still investigating that myself. And of … Continue reading First steps…

c# 8noda time

13 Apr 2018

jonskeet 8 min read

I started writing a blog post about versioning in July 2017. I’ve mostly abandoned it, because I think the topic is too vast for a single post. It potentially needs a whole site/wiki/repository devoted to it. I hope to come back to it at some point, because I believe this is a hugely important topic … Continue reading Backward compatibility…

c#evil code

17 Mar 2018

jonskeet 9 min read

This blog post was most directly provoked by this tweet from my friend Rob Conery, explaining why he’s giving up contributing on Stack Overflow. However, it’s been a long time coming. A while ago I started writing a similar post, but it got longer and longer without coming to any conclusion. I’m writing this one … Continue reading Stack Overflow…

stack overflow

2 Mar 2018

jonskeet 5 min read

Background There are three things you need to know to start with: Operations on read-only variables which are value types copy the variable value first. I’ve written about this before on this blog. C# 7.2 addresses this by introducing the readonly modifier for structs. See the language proposal for more details. I was touched to … Continue reading Implementing IXmlSerializable…

c#c# 7evil codenoda timeperformance

28 Nov 2017

jonskeet 4 min read

For a while, I’ve been considering how useful nuget.org statistics are. I know there have been issues in the past around accuracy, but that’s not what I’m thinking about. I’ve been trying to work out what the numbers mean at all and whether that’s useful. I’ve pretty sure an older version of the nuget.org gallery … Continue reading NuGet package…

general

8 Oct 2017

jonskeet 8 min read

This is an odd one. I’m currently working on Cloud Firestore support for C#, and I’ve introduced a GeoPoint struct to represent a latitude/longitude pair, each being represented by a double. It implements IEquatable and overloads == and != in the obvious way. So far, so good, and I have working tests which have passed … Continue reading Diagnosing a…

diagnostics

30 Aug 2017

jonskeet 5 min read

I do most of my work in the google-cloud-dotnet github repo (That’s the repo for the Google Cloud Client Libraries for .NET, just to get a quick bit of marketing in there.) We try to keep our build and test dependencies up to date, so I recently updated to the latest versions of Microsoft.NET.Test.Sdk and … Continue reading Diagnosing a…

diagnostics

19 Aug 2017

jonskeet 9 min read

Unlike the previous tests which have been based on Noda Time, this post is based on some issues I’ve had with my main project at work: the Google Cloud Client Libraries for .NET. Background This is somewhat detailed for those of you who really care about the chain of events. If you don’t, skip to … Continue reading Diagnosing a…

diagnostics

jonskeet 11 min read

In the last blog post, I investigated why my Noda Time tests on Travis were running much slower than those on AppVeyor. I resolved a lot of the problem just by making sure I was running release builds on Travis. That left a single test which takes up about half of the test time though: … Continue reading Diagnosing a…

diagnostics

17 Aug 2017

jonskeet 7 min read

I’ve previously blogged about a case where tests on .NET Core on Linux were much, much slower than the same tests on Windows. Today I’ve got a very similar problem – but I suspect the cause isn’t going to be the same. This is my reasonably raw log – skip to the end for a … Continue reading Diagnosing slow…

diagnostics

jonskeet 1 min read

For a long time, I’ve believed that diagnostic skills are incredibly important for software engineers, and often poorly understood. The main evidence I see of poor diagnostic skills is on Stack Overflow: “I have a program that does 10 things, and the output isn’t right. Please fix.” “I can’t post a short but complete program, … Continue reading Diagnostics everywhere!…

diagnostics

15 Aug 2017

jonskeet 2 min read

This is just a brief post that I’m hoping may help some people migrate to use .NET Core 2.0 SDK on Travis. TL;DR: see the end of the post for a sample configuration. Yesterday (August 15th), .NET Core 2.0 was fully released. Wonderfully, Travis already supports it. You just need dotnet: 2.0.0 in your YAML … Continue reading Using .NET…

c#noda time

9 Aug 2017

jonskeet 2 min read

I’ve got a few speaking engagements coming up that I thought it might be worth publicising a bit further. They’re all within just over a week of each other, which is going to be somewhat tiring, but… Here they are, in chronological order: Progressive .NET 2017 Progressive .NET 2017 will be held on September 13th-15th … Continue reading Upcoming speaking…

speaking engagements

25 Jun 2017

jonskeet 5 min read

9 days ago, I posted Imposter Syndrome (part 1) and then immediately listened to Heather Downing‘s excellent NDC talk on the topic. This is the “reflections afterwards” post I’d expected to write (although slightly more delayed than I’d hoped for). I’m not going to try to recap Heather’s talk, because that wouldn’t do justice to … Continue reading Imposter Syndrome…

general

16 Jun 2017

jonskeet 5 min read

Note: this is a purely personal post. It has no code in. It’s related to the coding side of my world more than the rest of who I am, so it’s in my coding blog, but if you’re looking for code, just move on. As part of a Twitter exchange, I discovered that Heather Downing … Continue reading Imposter syndrome…

general

26 Apr 2017

jonskeet 2 min read

This is a brief post documenting a very weird thing I partly came up with on Stack Overflow today. The context is this question. But to skip to the shock, we end up with code like this: That just shouldn’t happen. You shouldn’t be able to create an instance of an open type – a … Continue reading Surprise! Creating…

c#evil codestack overflow

23 Apr 2017

jonskeet 6 min read

This post is an attempt to reduce the number of times I need to explain things in Stack Overflow comments. You may well be reading it via a link from Stack Overflow – I intend to refer to this post frequently in comments. Note that this post is mostly not about text handling – see … Continue reading All about…

javastack overflow

10 Dec 2016

jonskeet 5 min read

Background I’m in the privileged position of receiving more invitations to speak (at conferences, user groups and podcasts) than I can realistically agree to. I’ve decided to start applying some new criteria to how I pick which ones I go to1. However, over the last couple of years as feminism has become an increasingly important … Continue reading Diversity and…

generalspeaking engagements

22 Jun 2016

jonskeet 1 min read

This was accidentally first posted here on my Code Blog. I deleted it and subsequently posted it in the proper place on my non-code blog. I’ve restored this placeholder post just so that anyone following links to it won’t get a 404…

uncategorized

9 Jun 2016

jonskeet 8 min read

I’ve been following the progress of .NET Core with a lot of interest, and trying to make the Noda Time master branch keep up with it. The aim is that when Noda Time 2.0 eventually ships (apologies for the delays…) it will be compatible with .NET Core from the start. (I’d expected to be able … Continue reading Tracking down…

benchmarkingc#diagnosticsgeneralperformance

28 Mar 2016

jonskeet 5 min read

Obviously I’d normally ask developer questions on Stack Overflow but in this case, it feels like the answers may be at least somewhat opinion-based. If it turns out that it’s sufficiently straightforward that a Stack Overflow question and answer would be useful, I can always repost it there later. The Facts Noda Time 1.x exists … Continue reading Versioning conundrum…

c#noda time

26 Mar 2016

jonskeet 10 min read

Source code for everything is on Github. It probably won’t be useful to you unless you’ve got very similar hardware to mine, but you may want to just have a look. Background Near the end of 2015, we had a new shed built at the back of our garden. The term “shed” is downplaying it … Continue reading Ultimate Man…

c#wacky ideas

8 Jan 2016

jonskeet 2 min read

Today I’ve been reviewing the ECMA-334 C# specification, and in particular the section about class instance constructors. I was struck by this piece in a clause about default constructors: If a class contains no instance constructor declarations, a default instance constructor is automatically provided. That default constructor simply invokes the parameterless constructor of the direct … Continue reading To base()…

c#evil code

27 Jul 2015

jonskeet 4 min read

First note: this blog post is very much tongue in cheek. I’m not actually planning on using the idea. But it was too fun not to share. As anyone following my activity on GitHub may be aware, I’ve been quite a lot of work on Protocol Buffers recently – in particular, a mostly-new port for … Continue reading “Sideways overriding”…

c#evil code

3 Jun 2015

jonskeet 7 min read

At the moment, I’m spending a fair amount of time thinking about a new version of the C# API and codegen for Protocol Buffers, as well as other APIs for interacting with Google services. While that’s the context for this post, I want to make it very clear that this is still a personal post, … Continue reading Backwards compatibility…

c#evil code

5 May 2015

jonskeet 7 min read

There are many, many questions on Stack Overflow about both parsing and formatting date/time values. (I use the term “date/time” to mean pretty much “any type of chronlogical information” – dates, times of day, instants in time etc.) Given how often the same kinds of mistakes are made, I thought it would be handy to … Continue reading Common mistakes…

generalnoda timestack overflow

21 Apr 2015

jonskeet 4 min read

As I’ve mentioned before, I’m part of the technical group looking at updating the ECMA-334 C# standard to reflect the C# 5 Microsoft specification. I recently made a suggestion that I thought would be uncontroversial, but which caused some discussion – and prompted this “request for comment” post, effectively. What does the standard say about … Continue reading Precedence: ordering…

c#

2 Mar 2015

jonskeet 9 min read

I’ve been getting a bit cross about backward compatibility recently. This post contains two examples of backward incompatibilities in .NET 4.6, and one example of broken code which isn’t being fixed due for backward compatibility reasons. Let me start off by saying this post is not meant to be seen as an attack on Microsoft. … Continue reading Backward compatibility…

generalnoda time

30 Jan 2015

jonskeet 3 min read

The problem Invoking event handlers in C# has always been a bit of a pain, because an event with no subscribers is usually represented as a null reference. This leads to code like this: It’s important to use the handler local variable, as if instead you access the field twice, it’s possible that the last … Continue reading Clean event…

c# 6

12 Jan 2015

jonskeet 2 min read

Last week I learned that using static is going to be the syntax for importing static members (including extension methods) in C# 6. That fulfils a feature request I made in September 2005 (my fourth ever blog post, as it happens). With a feature request turnaround of 10 years, I figure I should get put … Continue reading C# 7…

c# 7wacky ideas

8 Dec 2014

jonskeet 9 min read

Now that the Visual Studio 2015 Preview is available and the C# 6 feature set is a bit more stable, I figured it was time to start updating the Noda Time 2.0 source code to C# 6. The target framework is still .NET 3.5 (although that might change; I gather very few developers are actually … Continue reading C# 6…

c# 6noda time

1 Dec 2014

jonskeet 8 min read

Here’s a few things you may not be aware of: C# identifiers can include Unicode escape sequences (\u1234 etc) C# identifiers can include Unicode characters in the category “Other, formatting” (Cf) but these are ignored when comparing identifiers for equality The Mongolian Vowel Separator (U+180E) has oscillated between the Cf and Zs categories a couple … Continue reading When is…

c#evil code

7 Nov 2014

jonskeet 7 min read

When is a string not a string? As part of my “work” on the ECMA-334 TC49-TG2 technical group, standardizing C# 5 (which will probably be completed long after C# 6 is out… but it’s a start!) I’ve had the pleasure of being exposed to some of the interesting ways in which Vladimir Reshetnikov has tortured … Continue reading When is…

c#evil code

6 Nov 2014

jonskeet 3 min read

This post has a few purposes – it’s partly a bit of advertising, but it’s also meant to serve as a quick way of replying to speaking requests for a while… if you’ve been directed here by an email from me, I hope you’ll excuse the “form letter” approach. (You can probably skip down to … Continue reading Writing and…

booksc#speaking engagements

23 Oct 2014

jonskeet 7 min read

For a while now, I’ve been a big fan of a pattern in C# which mimics Java enums to a certain extent. In general, it’s a lovely pattern. Only after reading a comment on a recent blog post by Eric Lippert did I find out about a horrible flaw. Dubious thanks to John Payson for … Continue reading Violating the…

c#evil code

30 Sept 2014

jonskeet 9 min read

Note: I’ve now identified two bugs in TimeZoneInfo… details later in the post. Background Early on Friday morning (UTC), IANA released version 2014h of the time zone database. As a dutiful Noda Time maintainer, I fetched it, converted it into our native format, and ran the unit tests prior to pushing the new version. Unfortunately, … Continue reading The mysteries…

noda time

22 Aug 2014

jonskeet 9 min read

A comment on a Stack Overflow post recently got me delving into constants a bit more thoroughly than I have done before. Const fields I’ve been aware for a while that although you can specify decimal field as a const in C#, it’s not really const as far as the CLR is concerned. Let’s consider … Continue reading When is…

c#evil codecsharpevilcode

8 Aug 2014

jonskeet 3 min read

I started writing a post like this a long time ago, but somehow never finished it. Countless posts on Stack Overflow are vulnerable to SQL injection attacks. Along with several other users, I always raise this when it shows up – this is something that really just shouldn’t happen these days. It’s a well-understood issue,and … Continue reading The BobbyTables…

c#evil codestack overflow

1 Aug 2014

jonskeet 7 min read

A few days ago, I was watching Dustin Campell’s excellent talk from TechEd 2013, “Essential truths everyone should know about performance in a large managed code base”. I highly recommend it, and it made me think a bit more about Noda Time’s performance. (It doesn’t take much to make me think about Noda Time’s performance, … Continue reading Object pooling…

performance

25 Jul 2014

jonskeet 1 min read

As some of you have noticed (and let me know), my old blog hosting provider recently moved off Community Server to WordPress. I figured that as all the links we being broken anyway, now would be a good time to move off msmvps.com anyway. The old posts are still there, but my blog’s new home … Continue reading New blog…

general

16 Jul 2014

jonskeet 7 min read

Introduction Recently I’ve been optimizing the heck out of Noda Time. Most of the time this has been a case of the normal measurement, find bottlenecks, carefully analyse them, lather, rinse, repeat. Yesterday I had a hunch about a particular cost, and decided to experiment… leading to a surprising optimization. Noda Time’s core types are … Continue reading Micro-optimization: the…

c#evil codeperformance

3 Jun 2014

jonskeet 4 min read

(Note that I’m not talking about "processing collections in parallel, which is definitely not an anti-pattern…) I figured it was worth starting to blog about anti-patterns I see frequently on Stack Overflow. I realize that some or all of these patterns may be collected elsewhere, but it never hurts to express such things yourself… it’s … Continue reading Anti-pattern: parallel…

anti-patternsstack overflow

16 May 2014

jonskeet 7 min read

I’ve always found Portable Class Library (PCL) configuration to be a bit of a mystery. In simple cases, it’s simple: start a new PCL project in Visual Studio, select the environments you want to support, and away you go. But what’s going on under the hood, and what do all the options mean? How do … Continue reading Diagnosing Portable…

c#diagnostics

8 Apr 2014

jonskeet 3 min read

This post is the answer to yesterday’s brainteaser. As a reminder, I was asking what purpose this code might have: public static class Extensions { public static void Add<T>(this ICollection<T> source, T item) { source.Add(item); } } There are plenty of answers, varying from completely incorrect (sorry!) to pretty much spot on. As many people … Continue reading Extension methods,…

c#c# 6evil code

7 Apr 2014

jonskeet 1 min read

Just a really quick one today… What’s the point of this code? Does it have any point at all? public static class Extensions { public static void Add<T>(this ICollection<T> source, T item) { source.Add(item); } } Bonus marks if you can work out what made me think about it. I suggest you ROT-13 answers to … Continue reading Quick brainteaser…

c#evil code

4 Apr 2014

jonskeet 8 min read

It’s been a scandalously long time since I’ve blogged about C#, and now that the first C# 6 preview bits are available, that feels like exactly the right thing to set the keys clacking again. Don’t expect anything massively insightful from me just yet; I’d heard Mads and Dustin (individually) talk about some new features … Continue reading C# 6:…

c# 6

30 Jan 2014

jonskeet 2 min read

I was recently directed to an article on "tiny types" – an approach to static typing which introduces distinct types for the sake of code clarity, rather than to add particular behaviour to each type. As I understand it, they’re like type aliases with no conversions between the various types. (Unlike plain aliases, an object … Continue reading How many…

generalwacky ideas

20 Jan 2014

jonskeet 6 min read

I see a lot of problems which look somewhat different at first glance, but all have the same cause: Text is losing “special characters” when I transfer it from one computer to another Decryption ends up with garbage Compressed data can’t be decompressed I can transfer text but not binary data These are all cases … Continue reading Diagnosing issues…

diagnosticsgeneralstack overflow

14 Jan 2014

jonskeet 10 min read

As I begin to write this, I’m in a small cubicle in Philadelphia airport, on my way back from CodeMash – a wonderful conference (yet again) which I feel privileged to have attended. Personal top highlights definitely include Dustin Campbell’s talk on C# 6 (I’m practically dribbling with anticipation – bits please!) and playing Settlers … Continue reading A tale…

c#

21 Sept 2013

jonskeet 6 min read

It feels a little odd even to write this post, but I receive quite a few emails asking me for advice on how to get better at programming, how to get through interviews, whether it’s better to be a generalist or a specialist etc. I want to make it very clear right from the start, … Continue reading Career and…

general

19 Sept 2013

jonskeet 9 min read

Note: this blog post has now been turned into a video by Webucator, to go alongside their C# classes. (I’ve ended up commenting on this issue on Stack Overflow quite a few times, so I figured it would be worth writing a blog post to refer to in the future.) There are lots of ways … Continue reading Casting vs…

c#design

22 Jun 2013

jonskeet 5 min read

It seems to be quite a long time since I’ve written a genuine "code" blog post. Time to fix that. This material may well be covered elsewhere – it’s certainly not terrifically original, and I’ve been meaning to post about it for a long time. In particular, I remember mentioning it at CodeMash in 2012. … Continue reading Array covariance:…

benchmarkingc#designwacky ideas

21 Jun 2013

jonskeet 7 min read

This year before NDC, I wrote an article for the conference edition of "The Developer" magazine. Follow that link to find the article in all its illustrated glory (along with many other fine articles, of course) – or read on for just the text. Back when I used to post on newsgroups I would frequently … Continue reading But what…

general

20 May 2013

jonskeet 3 min read

Resources: Amazon, Barnes and Noble, Play Books The book’s web site (O’Reilly) – downloads, errata etc A while ago I was attending one of the Developer, Developer, Developer conference in Reading, and I heard Alex Davies give a talk about actors and async. He mentioned that he was in the process of writing a short … Continue reading Book Review:…

asyncbook reviewsbooksc# 5

18 Apr 2013

jonskeet 1 min read

A little while ago I was contacted about a new merge tool from the company behind PlasticSCM. (I haven’t used Plastic myself, but I’d heard of it.) My initial reaction was that I wasn’t interested in anything which required me to learn yet another source control system, but SemanticMerge is independent of PlasticSCM. My interested … Continue reading New tool…

c#general