Behind the compiler: 20 examples of C# code before and after compiling
Tags: dotnet, csharp, visualstudio
Published: 2020-01-23 06:57:47

---
title: Behind the compiler: 20 examples of C# code before and after compiling
published: true
date: 2020-01-22 05:00:16 UTC
tags: dotnet,csharp,visual-studio
canonical_url: https://gunnarpeipman.com/behind-the-compiler/
---

Over years I have written many blog posts about C# and .NET that demonstrate also how things work internally and what C# compiler produces from the code we write. I have called these chapters usually as “Behind the compiler”. 

### Behind the compiler posts

1. [Throw expressions in C# 7.0](https://gunnarpeipman.com/csharp-throw-expressions/ "Throw expressions in C# 7.0")
2. [Using-declarations in C# 8.0](https://gunnarpeipman.com/csharp-using-declarations/ "Using-declarations in C# 8.0")
3. [Expression bodied members in C# 7.0](https://gunnarpeipman.com/csharp-expression-bodied-members/ "Expression bodied members in C# 7.0")
4. [More expression-bodied members in C#](https://gunnarpeipman.com/csharp-expression-bodied-members-2/ "More expression-bodied members in C#")
5. [Internals of tuple literals](https://gunnarpeipman.com/csharp-tuple-literals-internals/ "Internals of tuple literals")
6. [Default literal expressions in C# 7.1](https://gunnarpeipman.com/csharp-default-literal-expressions/ "Default literal expressions in C# 7.1")
7. [C# and Partial Classes](https://gunnarpeipman.com/csharp-partial-classes/ "C# and Partial Classes")
8. [Non-trailing named arguments in C# 7.2](https://gunnarpeipman.com/csharp-non-trailing-named-arguments/ "Non-trailing named arguments in C# 7.2")
9. [Writing IL code on Visual Studio](https://gunnarpeipman.com/il-visual-studio/ "Writing IL code on Visual Studio")
10. [IL perversions: throwing and catching strings](https://gunnarpeipman.com/il-perversions-throwing-and-catching-strings/ "IL perversions: throwing and catching strings")
11. [var keyword in C#](https://gunnarpeipman.com/var-keyword/ "var keyword in C#")
12. [Pattern matching in switch statements](https://gunnarpeipman.com/csharp-pattern-matching-switch/ "Pattern matching in switch statements")
13. [Adding attribute to backing field of automated property](https://gunnarpeipman.com/csharp-backing-field-attribute/ "Adding attribute to backing field of automated property")
14. [Are lock and Monitor the same in C#?](https://gunnarpeipman.com/csharp-lock-monitor/ "Are lock and Monitor the same in C#?")
15. [Deep dive to async Main](https://gunnarpeipman.com/csharp-async-main/ "Deep dive to async Main")
16. [Anonymous types in C#](https://gunnarpeipman.com/csharp-anonymous-types/ "Anonymous types in C#")
17. [Out variables in C# 7.0](https://gunnarpeipman.com/csharp-out-variables/ "Out variables in C# 7.0")
18. [All about IDisposable](https://gunnarpeipman.com/csharp-idisposable/ "All about IDisposable")
19. [Code Contracts: How they look after compiling?](https://gunnarpeipman.com/code-contracts-how-they-look-after-compiling/ "Code Contracts: How they look after compiling?")
20. [Automatic properties in C#](https://gunnarpeipman.com/csharp-automatic-properties/ "Automatic properties in C#")

The post [Behind the compiler: 20 examples of C# code before and after compiling](https://gunnarpeipman.com/behind-the-compiler/) appeared first on [Gunnar Peipman - Programming Blog](https://gunnarpeipman.com).