Welcome to MSDN Blogs Sign in | Join | Help

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#.

Published Wednesday, April 04, 2007 2:23 PM by ShawnHargreaves

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Wednesday, April 04, 2007 8:16 PM by JoelMartinez

# re: A calculator called Eric

"Please don't tell any of the guys here at Microsoft ..."

You're doing a terrible job at keeping the secret ;-)

Thursday, April 05, 2007 8:04 PM by zygote

# re: A calculator called Eric

LOL :)

Friday, April 06, 2007 1:25 AM by JoelBennett

# re: A calculator called Eric

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

Friday, April 06, 2007 11:17 AM by ShawnHargreaves

# re: A calculator called Eric

"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!

Wednesday, July 09, 2008 10:44 AM by XNAInfo blogs

# Beginning is hard for beginners?

Beginning is hard for beginners?

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker