Programming

Reading Roundup

Only the finest material makes it to thegoldenmule’s Reading Roundup series. This time, I even included a video for you folks that can’t read!   Predicting the Future, by Alan Kay http://www.ecotopia.com/webpress/futures.htm This is the one where Kay famously says, “the best way to predict the future is to invent it.” And it’s brilliant. I […]

More

More Memoization

I had to cache the results a couple methods recently, and only after I had done it a few times, I realized I should just write a memoization extension for System.Func. public static Func Memoize(this Func func) { Dictionary dict = new Dictionary(); return input => { if (!dict.ContainsKey(input)) { dict[input] = func(input); } return […]

More

Reading Roundup

Loyal followers! I’m not dead! In fact I’ve been working away on a few cool projects, but I’m not quite ready to divulge. Anyway, I thought I would post about a few different resources I’ve been reading through lately:   A Conversation with Anders Hejlsberg You have to read every word. Seriously, stop reading this […]

More

Quick Post: Easy Enums

On any engineering team, it’s sometimes difficult to agree on best practices. Everyone has different ideas of good style, consistency, etc. But there’s one thing we’ve reached consensus on: enums. Here is what our best practices say an enum definition should look like (keep in mind, this is only for int valued enums): public enum […]

More

C# Musings…

I had a few ideas for C# constructs, so I thought I might as well write them down. Perhaps, some day, someone can tell me why these don’t exist… Making Generics More Generic Several times I’ve been frustrated by the fact that Func<TResult> has a bunch of variants. Wouldn’t it be cool it you could […]

More