- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
It is clear to me that the method name was actually spelled "evil()".
Admin
I admit, I'm guilty as charged: this is the simple most ridiculous thing I've seen in a loooong while, and I've never seen this exact "pattern" before in my life. My will to live has gone down a few notches, for sure.
Admin
It's nice because it avoids that pesky syntax highlighting! There are lots of great uses for JIT compiling for HPC. An easy one that comes to mind is if certain conditions change only at runtime and you'd normally need a plethora of if-statements to handle them. By evaluating those if-statements once to generate a streamlined block of code, you are allowing (nearly) all predictive execution by the compiler to be valid!
Admin
Admin
I've heard of someone doing this (or its moral equivalent), assembling their application classes dynamically by fetching snippets of source code out of a database. I'm really pleased that I didn't call the guy a dangerous lunatic to his face.
Admin
I am confused, this code has nothing to do with C# at all, my guess is it's Java/Javascript because Application is in C# a static class (at least for WinForm applications) and method names in C# are always Pascalcase, not Camelcase.
And yes, you can JIT compile code with the compiler as a service API, but that looks completely different.
Admin
Dynamic Code Generation has been a part of the [full] Framework forever. In fact many of the key web technologies are based on it
https://docs.microsoft.com/en-us/dotnet/framework/reflection-and-codedom/dynamic-source-code-generation-and-compilation. Wrapping it as an eval (even neglecting MaxiTB's observation) is an "interesting" approach semantically, but that is about it...
Admin
Compiler as a service is around since Roslyn; it has nothing to do with CodeDOM ;-) Yes, you could emit IL before that; and yes, with expression trees it became easier, but before CaaS directly compiling code without going over MSBuild was not possible ;-)
https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/
And again, the syntax is not valid C#.
Admin
You have no idea what you are talking about.