A calculator called Eric

Please don't tell any of the guys here at Microsoft, but back in 2005 when I interviewed for my job on the XNA team, I had never actually written anything using .NET!

After the interview but before I accepted the job, I decided I had better learn C#, to make sure it didn't completely suck and that I wasn't going to hate programming in it.

My learning project ended up as a calculator utility called Eric. I think it's pretty neat. It can be used from the commandline to evaluate simple expressions, or you can define your own functions for more complex stuff, and it has a graph window that can display not only the usual y=f(x) type curves, but also parametric curves (x=f(t), y=g(t)), cartesian curves (f(x,y)=0), and sets.

The implementation is way more complicated than I would normally be happy with, because I was deliberately experimenting with advanced features like threading, closures, and reflection, plus trying to apply patterns from the worlds of generic, dynamic, and functional programming. I went overboard using Reflection.Emit to generate IL that evaluates user defined functions as quickly as possible. Gross overkill, but it was a great learning exercise!

The experiment was a success. I fell madly in love with C#.

Comments (5)

  1. JoelMartinez says:

    "Please don’t tell any of the guys here at Microsoft …"

    You’re doing a terrible job at keeping the secret 😉

  2. JoelBennett says:

    So just out of curiosity, why name it Eric?  Why not Bob or Ralph, or some other name? 😛

  3. ShawnHargreaves says:

    "So just out of curiosity, why name it Eric?"

    No reason, I just had to call it something and that seemed like as good a name as any!

  4. Beginning is hard for beginners?

Skip to main content