We’ve been struggling in the last four episodes to encode the rules of our business domain — which, recall, could be wizards and warriors or papers and paycheques or whatever — in… | Continue reading
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 e… | Continue reading
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 compa… | Continue reading
The mathematician John Horton Conway has died, apparently due to the covid-19 epidemic, at the age of 82. I never met him but by all accounts, he was a delightful person and brilliant mathematician… | Continue reading
What regular work activity has the highest impact on the organization in the least amount of time and effort? I haven’t done any science on this, but anecdotally it sure feels like recruiting… | Continue reading
Most C# developers understand that there’s a difference between a “rectangular” and a “ragged” two-dimensional array. int[,] rectangle = { {10, 20}, {30, 40}, {50, 60} }; int[][] ragged = { … | Continue reading
The final part of my Life series is still in the works but I need to interrupt that series with some exciting news. The new programming language I have been working on for the last year or so has j… | Continue reading
All right, we have our quad data structure, we know how to get and set individual elements, and we know how to display it. We’ve deduplicated it using memoization. How do we step it forward o… | Continue reading
UPDATE: This article was featured in The Best Software Writing I. Thanks Joel! Joe Bork has written a great article explaining some of the decisions that go into whether a bug is fixed or not. This… | Continue reading
Part 33 of my ongoing series is coming but I did not get all the code written that I wanted to this week, so it will be delayed. In the meanwhile: Living in Canada as a child, of course I grew up l… | Continue reading
The way you typically represent a “missing” or “invalid” value in C# is to use the “null” value of the type. Every reference type has a “null” value;… | Continue reading
In today’s episode I want to again pause for a moment — this time, to verify that our allegedly O(change) implementation of Stafford’s algorithm really does have its performance g… | Continue reading
Source code for this episode is here. We are continuing with our project to gradually morph Abrash’s “remember the living neighbour counts” algorithm into Stafford’s algorit… | Continue reading
Last time on FAIC we took a look at Scholes’ extremely concise Life algorithm, which treats a grid as an array that you can treat as a mathematical value with some unusual but entirely straig… | Continue reading
> go north You are facing the north side of a white house. There is no door here, and all the windows are boarded up. A narrow path winds north through the trees. > go north | Continue reading
Code for this episode can be found here. All right, let’s get into it. Since I want this series to concentrate on the algorithms and not the user interface, what I will probably do is make in… | Continue reading
Code for this episode can be found here. There are literally fifty years of articles explaining Conway’s Game of Life, starting with the one that introduced it to me: the October 1970 issue o… | Continue reading
A student who I used to tutor in CS occasionally sent me a meme yesterday which showed “NEW GRAD vs SENIOR DEVELOPER”; the new grad is all caps yelling NO! YOU CAN’T JUST USE BRUT… | Continue reading
Good Friday afternoon all and welcome to this working-from-home-and-obsessively-washing-hands edition of FAIC. I am posting today from my recently-transformed spare room which is now apparently my … | Continue reading
Here’s an interesting question I saw on StackOverflow recently; it was interesting because the answer seems obvious at first, but making a small change to the question makes the answer very d… | Continue reading
My manager and I got off on a tangent in our most recent one-on-one on the subject of the durability of design mistakes in programming languages. A particular favourite of mine is the worst of the … | Continue reading
Writing good error handling code is hard in any language, whether you have exception handling or not. When I’m thinking about what exception handling I need to implement in a given program, I… | Continue reading
One last post for this decade. There has been some discussion on tech twitter lately on the subject of whether it is possible to be “successful” in the programming business without work… | Continue reading
One last post for this decade. There has been some discussion on tech twitter lately on the subject of whether it is possible to be “successful” in the programming business without work… | Continue reading
You might recall that before my immensely long series on ways we could make C# a probabilistic programming language, I did a short series on how we can automatically computed the exact derivative i… | Continue reading
Source code for this episode is here. Welcome to this special bonus episode of Fixing Random, the immensely long blog series where I discuss ways to add probabilistic programming features into C#. … | Continue reading
All right, let’s finish this thing off! First, I want to summarize, second I want to describe a whole lot of interesting stuff that I did not get to, and third, I want to give a selection of papers… | Continue reading
Last time on FAIC we were attacking our final problem in computing the expected value of a function f applied to a set of samples from a distribution p. We discovered that we could sometimes do a &… | Continue reading
(This is a follow-up article to my post on generating random data that conforms to a given distribution; you might want to read it first.)Here’s an interesting question I was pondering last w… | Continue reading
A common and entirely sensible programming practice is to put commonly used utility functions in one file, and then somehow link that file in to many different programs. In traditional compiled lan… | Continue reading
One of the most frequent categories of bad questions I see on StackOverflow is: I wrote this program for my assignment and it doesn’t work. [20 lines of code]. And… that’s it. If … | Continue reading
We’ll get back to stochastic programming soon; I wanted to do a quick post about some updates to my earlier series on anti-unification. As I noted in the final part of that series, I spent a … | Continue reading
We’ve been mostly looking at small, discrete distributions in this series, but we started this series by looking at continuous distributions. Now that we have some understanding of how to sol… | Continue reading
[Code for this episode is here.] So far in this series we’ve very briefly looked at continuous distributions on doubles, and spent a lot of time looking at discrete distributions with small s… | Continue reading
Occasionally I get questions from people who are confused over the semantics of data that are not even there. Usually they’ve written code something like If Blah = Nothing Then or If Blah = E… | Continue reading
Last time in this series I proposed a stripped-down DSL for probabilistic workflows. Today, let’s see how we could “lower” it to ordinary C# 7 code. I’ll assume of course th… | Continue reading
I mentioned Hungarian Notation in my last post — a topic of ongoing religious controversy among COM developers. Some people swear by it, some people swear about it. The anti-Hungarian argumen… | Continue reading
Thanks again to the good people at Microsoft who have kept my old blog alive for now; my plan is to port the articles from the old site over, and then they will redirect from the old URLs to the ne… | Continue reading
I’ve got no code for you this time; instead here are some musings about language design informed by our discussion so far. One of the most important questions to ask when designing a language… | Continue reading
For reasons unknown to me, my MSDN blog has been deleted without warning. (Microsoft, I would have appreciated a heads-up. It’s not like you don’t know how to reach me!) This is unfortu… | Continue reading
As long-time readers of my blog know, I’m a big fan of functional persistent immutable list data structures. I recently learned about a somewhat bizarre but very practical implementation of s… | Continue reading
How to say this delicately? I really, really dislike System.Random. Like, with a passion. It is so… awful. The C# design team tries hard to make the language a “pit of success”, w… | Continue reading
Pop quiz: Consider these little methods. (They could be static, inline, whatever, that doesn’t matter.) int[] A1() { Console.WriteLine(“A”); return new int[10]; } int[] A2() {… | Continue reading
Happy New Year all and welcome to another year of having fabulous adventures in coding. I thought I’d start this year off by answering a question I get quite frequently: I have a public outer… | Continue reading
Good day all, before we get into the continuation of the previous episode, a few bookkeeping notes. First, congratulations to the Python core developers on successfully choosing a new governance mo… | Continue reading
Eric Lippert's blog | Continue reading
A common problem I see in object-oriented design is: A wizard is a kind of player. A warrior is a kind of player. A staff is a kind of weapon. A sword is a kind of weapon. A player has a weapon. Bu… | Continue reading
You are standing in an open field west of a white house, with a boarded front door. You could circle the house to the north or south. There is a small mailbox here. > open the mailbox Opening th… | Continue reading