views:

303

answers:

2
  • 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?

+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
+1: One person's trick another's user experience.
Preet Sangha
*And then a miracle occurs.*
Robert Harvey
It's called "Edit and Continue" or "EnC" for short: http://msdn.microsoft.com/en-us/library/bcew296c(VS.100).aspx
Brian
Surely 'trick' isn't the most descriptive word here, summons up illusions of magicians in pointy hats :)
Peter McGrattan
"Any sufficiently advanced technology is indistinguishable from magic."
spender
I think we need to know the details of the "trick"?
andy
@spender: Now as before that depends on the audience
Peter McGrattan
+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