- I thought that C# generated compiled code (by JIT)
But I have lately discovered that I can edit code while debugging mode in C# (VS 2008)
Does that means that C# is interpreted? or there is a trick?
views:
303answers:
2
+15
A:
It's a trick. The C# compiler/debugger/IDE is just smart and can compile code on the fly while you're debugging.
Greg Hewgill
2010-05-05 22:38:00
+1: One person's trick another's user experience.
Preet Sangha
2010-05-05 22:38:47
*And then a miracle occurs.*
Robert Harvey
2010-05-05 22:40:37
It's called "Edit and Continue" or "EnC" for short: http://msdn.microsoft.com/en-us/library/bcew296c(VS.100).aspx
Brian
2010-05-05 22:41:11
Surely 'trick' isn't the most descriptive word here, summons up illusions of magicians in pointy hats :)
Peter McGrattan
2010-05-05 22:43:06
"Any sufficiently advanced technology is indistinguishable from magic."
spender
2010-05-05 22:44:24
I think we need to know the details of the "trick"?
andy
2010-05-05 22:47:53
@spender: Now as before that depends on the audience
Peter McGrattan
2010-05-05 22:48:41
+4
A:
C# is compiled to IL which is then JIT'ed at runtime into instructions specific to the processor the program is running on.
Editing code while debugging C# is a feature of VS2008 which more than likely compiling any changes in the background
Peter McGrattan
2010-05-05 22:39:10