Hacker News new | past | comments | ask | show | jobs | submit login

Interesting use of code generation - pretty cool, oft unused part of .net/C#. Also interesting how it's designed to be a drop-in single C# file, that often seems the easier way of getting functionality into a project, side-stepping DLL version issues.



Looking at the dynamic code gen... is it necessary? Can't they just use a method that takes 'type' and the set of properties as arguments? I'm sure I'm missing something, but don't see it at the moment.


it's an optimization so that you don't die from the reflection cost.


OK, I buy that.


I assume they've tested it out and aren't just assuming that the reflection would be a killer... but...


I don't see code-generation; what are you referring to?


I mean dynamic code generation at runtime, rather than actually outputting text :-)

E.g. CreateParamInfoGenerator() at line 208.


Yes, you're right. It's pretty cool.

Also, if you're looking for other cool samples, there's a chapter in "Beautiful Code" by Charles Petzold you may find interesting.


It looks like it is using the Reflection Emit capabilities of .Net:

http://msdn.microsoft.com/en-us/library/8ffc3x75.aspx




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: