Wizards and Warriors, Part Five

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


@ericlippert.com | 2 years ago

Persistence, façades and Roslyn’s red-green trees (2012)

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


@ericlippert.com | 2 years ago

What Would Feynman Do? (2011)

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


@ericlippert.com | 2 years ago

Life (38-part series on Conway's Game of Life)

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


@ericlippert.com | 3 years ago

Hey now, you’re an all-star

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


@ericlippert.com | 3 years ago

Arrays of Arrays(2009)

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


@ericlippert.com | 3 years ago

Bean Machine: A Probabilistic Programming Language

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


@ericlippert.com | 3 years ago

Life, part 34

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


@ericlippert.com | 3 years ago

How many Microsoft employees does it take to change a lightbulb? (2004)

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


@ericlippert.com | 3 years ago

Approximate Results May Vary

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


@ericlippert.com | 3 years ago

Null is not false (2012)

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


@ericlippert.com | 3 years ago

Life, part 20

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


@ericlippert.com | 3 years ago

Life, Part 16

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


@ericlippert.com | 3 years ago

Life, part 8

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


@ericlippert.com | 3 years ago

North of House (2016)

> 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


@ericlippert.com | 3 years ago

Life, part 3

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


@ericlippert.com | 4 years ago

Life, part 2

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


@ericlippert.com | 4 years ago

New Grad vs. Senior Dev

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


@ericlippert.com | 4 years ago

Working from Home

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


@ericlippert.com | 4 years ago

Passing Awaited Tasks

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


@ericlippert.com | 4 years ago

Hundred Year Mistakes

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


@ericlippert.com | 4 years ago

Vexing Exceptions

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


@ericlippert.com | 4 years ago

Hard Work and Success

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


@ericlippert.com | 4 years ago

Work and Success

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


@ericlippert.com | 4 years ago

Fixing Random, bonus episode 3

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


@ericlippert.com | 4 years ago

Fixing Random: pigeons and the noisy-or distribution

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


@ericlippert.com | 4 years ago

Fixing Random, part 40 of 40

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


@ericlippert.com | 4 years ago

Fixing Random, Part 38

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


@ericlippert.com | 4 years ago

How much bias is introduced by the remainder technique?

(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


@ericlippert.com | 4 years ago

Why is there no #include? (2003)

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


@ericlippert.com | 4 years ago

How to debug small programs (2014)

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


@ericlippert.com | 4 years ago

Applying machine learning to coding itself

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


@ericlippert.com | 4 years ago

Fixing Random, Part 26

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


@ericlippert.com | 5 years ago

Fixing Random, Part 24

[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


@ericlippert.com | 5 years ago

A Whole Lot of Nothing (2003)

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


@ericlippert.com | 5 years ago

Fixing Random, Part 21

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


@ericlippert.com | 5 years ago

What’s Up with Hungarian Notation? (2003)

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


@ericlippert.com | 5 years ago

Porting old posts, part 1

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


@ericlippert.com | 5 years ago

Programming language design: the balance between generality and specificity

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


@ericlippert.com | 5 years ago

So Long, MSDN Blog

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


@ericlippert.com | 5 years ago

An interesting list structure, part 1

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


@ericlippert.com | 5 years ago

Fixing random, part 1

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


@ericlippert.com | 5 years ago

Indexer error cases

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


@ericlippert.com | 5 years ago

Accessibility of nested classes

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


@ericlippert.com | 5 years ago

Removing a recursion in Python, part 2 (implementing continuation passing style)

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


@ericlippert.com | 5 years ago

Removing a recursion in Python, part 1

Eric Lippert's blog | Continue reading


@ericlippert.com | 5 years ago

Wizards and warriors, part one

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


@ericlippert.com | 5 years ago

West of house (2016)

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


@ericlippert.com | 5 years ago