C# Expression Evaluators

Warning: this is not the usual code sample ready to be cut and pasted in your homework due for tomorrow.

OTOH, if you are one of those guys that just have to understand why and how you can implement an expression evaluator in C#, then boy has Chuck Jazdzewski some interesting information for you. Chuck likes to propose interesting problems/challenges (often useless yet fascinating) and then discuss at detail various approaches to the problem, in the case of expression evaluators, Chuck offers us four alternatives:

  1. The classic procedural solution (á la plain old Visual Basic)
  2. The object oriented solution (at the best 199x Smalltalk/Java style)
  3. The visitor pattern solution (for the guys one stair above average Java or C# programmers)
  4. The layered solution using partial classes (for the neoteric programmers using C# 2.0 or VB.NET 2005)

As I said, don't expect a complete solution ready to be run but some pseudo-code and an interesting discussion of pros and cons. It may not help you with tomorrow's homework but it sure will help you impress the geek gal on the next cubicle.

Published Tuesday, June 06, 2006 1:30 AM by Edgar Sánchez

Comments

# News: TestDriven, SideKick, Expression Evaluators and Security to boot

Wednesday, June 07, 2006 2:52 AM by ISerializable - Roy Osherove's Blog
I've gathered some interesting links posted only yesterday, so I don't forget (and neither should you)....

# Evaluating Expressions at Runtime in .NET (C#) « HSI Developer Blog

Pingback from  Evaluating Expressions at Runtime in .NET (C#) « HSI Developer Blog

# Evaluating Expressions at Runtime in .NET (C#) | The Freak Parade

Pingback from  Evaluating Expressions at Runtime in .NET (C#) | The Freak Parade

Leave a Comment

(required) 
(required) 
(optional)
(required)