C# compiler expand our code? [Archive] - C Board

PDA

View Full Version : C# compiler expand our code?


George2
05-01-2008, 07:03 AM
Hello everyone,


How could we see the C# compiler expand our code (I mean at source code level, not using ILDasm to see at IL level or using Diassembly at native assembly code level)?

For example, this is how foreach is expanded in C#.

http://www.csharpfriends.com/Spec/index.aspx?specID=15.8.4.htm


thanks in advance,
George

DanFraser
05-02-2008, 05:40 AM
Why would you want to do this? The point of a language such as C# is to make it easier to read.

George2
05-03-2008, 01:41 AM
Thanks DanFraser,


Understanding how internal works will make us write better code, like when we know how compiler works, we will write better code. :-)

Any ideas to my original question?

Why would you want to do this? The point of a language such as C# is to make it easier to read.


have a good weekend,
George