# Monday, May 08, 2006

I’ve been doing some CodeDOM work in the last week or so after not having done it much in a while.  What I’m finding most difficult is keeping track of which constructs are usable and which aren’t.  Being a C# programmer, I tend to think about the code that way.  The hardest part about using the CodeDOM is upleveling your thinking to deal with meta-programming.  Describing the construct you want in the constructs of the CodeDOM can be challenging.

Given all that, I can understand why there are no CodeDOM constructs for foreach, using, lock, etc.  Those are C# language constructs that expand to some other CLR goo.  But ,while?  There’s no way to make a while construct in CodeDOM.  ????  I’m pretty sure there’s nothing language specific about a do…while construct.  So you have to translate into a for…next instead.  Sigh.  I’m glad I don’t have to deal with delegates for this code.  That’d be a third level abstraction, which is more than I can handle…

Monday, May 08, 2006 1:09:00 PM (Pacific Daylight Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Related posts:
Calling a Duplex Contract from ASP.NET
Snippets begone!
Snippets, or DOM?
CodeDOM is too hard
Testing the output of code generation

Monday, May 08, 2006 6:52:16 PM (Pacific Daylight Time, UTC-07:00)
The worst CodeDOM experience I had was a couple years ago, when I was doing a bunch of work with reflection. Except all this code was generated, so I found myself writing code to generate code to do late-bound function invocation via reflection.

I was cross-eyed for a week after that.
Comments are closed.