Decompiler vs having source

One of the big reasons it’s cool to have the source code for something you’re working with is so you can see what it’s doing.  (How often do most people actually modify the source code to an open source program or library?  Very rarely compared to how often you use it).  But what if you could see what it’s doing without having the source?

 


 

Reflector now has a C# code generator, that generates C# code based on the IL it finds.  It works amazingly well. 

 





private void CheckScope(TypeScope scope)
{





if (this.scope == null)
{





this.scope = scope;
return;
}
if (this.scope != scope)
{





throw new InvalidOperationException(Res.GetString(“XmlMappingsScopeMismatch”));
}
}

 

That’s code generated by the decompiler.  It’s awesome for answering “I wonder what CheckScope does..“