This is the November 2008 update of my now famous "Mixing Static & Dynamic .NET Languages" presentation. OK, so it's not a famous talk. But it still rocks and the folks at the code camps love it. This is the material I will be using at my talk at the upcoming Raleigh Code Camp on 11/15/2008. The source code and slides are attached below. When you run the demo code, you'll see a dialog that looks like this:
The application, written primarily in C#, implements a shopping cart to which various products can be added. The shopping cart isn't the cool part, of course. What's interesting is the use of Python code to implement the discounting/marketing rules within the cart. If you press the Show Rules Editor button at the top of the form, you'll see the rule editor dialog:

Python code is pretty easy to read isn't it? You can probably follow the logic to see that if certain counts of Entertainment products are added, they get discounted at various levels. And a trigger is set on the total count of items in the cart, too. There's a bug in the code though. But that's part of the demo. Can you find the bug?
Hopefully, if you run this code and understand it, you mind will be expanded a bit. One of the most often asked questions I get when talking about IronPython is, "How do I convince my boss to let me write that application in Python?" My answer is, "You don't have to write the whole thing in Python. With the fantastically rich hosting APIs in the .NET Dynamic Language Runtime (DLR), you can write the portions that need dynamism in Python and write the rest in C# or VB.NET." In fact, for most applications, the portion that can benefit from dynamic behavior is usually fairly small as a percentage of the application's total surface area. So this model of mixing static and dynamic languges is a nice approach to those kinds of problems.
Slides for MixingStaticAndDynamicDotNETLanguages 20081115.pptx (251KB)
Source Code for MixingStaticAndDynamicLanguagesInDotNet 20081109 (43KB)