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.

5 Comments

  • To be both a speaker of words and a doer of deeds.

    -----------------------------------

  • If you are interested in another take on this, I've just published an article on this very subject and, so far, I haven't seen anyone else take the approach I did. If anyone's interested, you can see the code at http://www.blackbeltcoder.com/Articles/algorithms/a-c-expression-evaluator.

  • -----------------------------------------------------------
    "sometimes people here the words net marketing they usually assume, yahoo or facebook or myspace, but there may be a bunch of other strategies to basically market a site or business enterprise and get your way up there like myspace did."

  • hank for this very good web log! I totally appreciate it!

  • With havin so significantly content and articles do you ever run into any problems of plagorism or copyright violation? My weblog has plenty of special content I've either written myself or outsourced but it appears loads of it truly is popping it up all over the world wide web without having my agreement. Do you know any strategies to support avoid content from becoming stolen? I'd actually appreciate it.

Comments have been disabled for this content.