Skip to content

Commit 21807f2

Browse files
Pavel-Durovgadilashashank
authored andcommitted
Add C# chapter (#31)
* summary csharp chapter links * Csharp chapter: README file * Csharp chapter: intro Sections: + Inception, + What is C#? + ## Why C#? + ## Why not C#? + ## Conclusion * Csharp chapter: refacotring * Csharp chapter: spelling * Csharp chapter: splitting intro.md into multiple files * Csharp chapter: splitting intro.md into multiple files * Csharp chapter: removing trailing spaces + changing " to ” * Csharp chapter: splitting single long line into two * Typos and slight modifications. * Some corrections. * Some structure changes * Update intro.md * Travis * Random typo
1 parent 1992701 commit 21807f2

7 files changed

Lines changed: 69 additions & 0 deletions

File tree

book/SUMMARY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@
3838
* [Conclusion](languages/python/conclusion.md)
3939

4040

41+
* [C#](languages/csharp/README.md)
42+
43+
* [Introduction](languages/csharp/intro.md)
44+
45+
* [History](languages/csharp/history.md)
46+
47+
* [Advantages](languages/csharp/advantages.md)
48+
49+
* [Disadvantages](languages/csharp/disadvantages.md)
50+
51+
* [Conclusion](languages/csharp/conclusion.md)
52+
53+
4154
* [C++](languages/cpp/README.md)
4255
* [Introduction](languages/cpp/intro.md)
4356

book/languages/csharp/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Welcome
2+
3+
> This chapter has been authored by Pavel Durov
4+
5+
Welcome to the C# chapter!
6+
7+
In this chapter, we are going to explore C# and the .NET Framework in general.
8+
We'll start with the basics and dive into the details as we advance through the chapter.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Advantages
2+
3+
C# was designed to be simple and easy to use, its syntax is very natural and non-verbose. As a high-level language, it abstracts away most of the complex details, giving the user an ability to focus on its pure programming tasks instead of worrying about the little bits.
4+
5+
While abstracting away the details, C# doesn't limit your abilities and gives you the option to work on a lower level using features like *Interoperability* which enables you to take advantage of unmanaged code such as C/C++ directly from your code.
6+
7+
C# is a managed programming language which means the programmer need not worry about memory management. It is dealt by the GC (Garbage collector) of the .NET Framework.
8+
9+
Another advantage of managed code is that it becomes platform-independent, meaning that it can be run on any platform with .Net Framework installed, but it's not limited to it.
10+
Thanks to Mono project, there are other technologies that support C# as its primary language. Tools like Unity and Xamarin allow you to write C# code and run it on any platform of your choice.
11+
12+
It's a type-safe compiled language, meaning that your code is verified by the compiler before its execution, making your code more resilient to runtime errors by catching them ahead of time.
13+
14+
C# belongs to the C-family of programming languages and anyone comfortable in using other languages belonging to the same family like C, C++ or Java will feel comfortable in using it.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Conclusion
2+
3+
C# is a great modern language, with a large development community and Microsoft support.
4+
It's used in many enterprise applications on client and server sides.
5+
6+
In the next chapters, we'll dive into C# and explore it from the ground up.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Disadvantages
2+
3+
Compiled code is usually seen as an advantage, but it also has its own drawbacks. If you change any part of your code, you must recompile the whole application, this makes the deployment process a bit tedious.
4+
5+
Even though C# is a compiled language, it's not as fast as native code compiled languages. The two main reasons for this are: C# is compiled to IL (intermediate language) instead of machine code and due to the overhead added by the GC (garbage collector)
6+
7+
Finally, even though C# is Cross-Platform compatible, it is still used mainly within .NET ecosystem and you would most likely see C# on Windows based OS. Nowadays it's gaining popularity (especially since .NET Core release) and is also being seen on other platforms as well such as on Linux and Mac.

book/languages/csharp/history.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# History
2+
3+
C# was Developed by Anders Hejlsberg at Microsoft as part of .NET framework initiative in the late 2000's.
4+
5+
The name comes from musical notation where a sharp symbol(#) sets the note higher in pitch by one semitone. The story of naming this language is similar to that of C++, where the ++ being the increment operator, was meant to say that C++ is an improvement over C.
6+
7+
Some say that the sharp symbol also resembles four ”+” symbols (in a 2x2 grid), implying that the language is an increment of C++.
8+
9+
In its early 1.0 version, C# looked a lot like its predecessor Java (released in 1991).
10+
But it has grown quickly since then. With extensive support from Microsoft promoting C# as its primary .NET framework language, it gained a large audience and became one of the most popular programming languages in the world.
11+
12+
At the time of writing this chapter, C# version stands at 7.0 and is continuously evolving.

book/languages/csharp/intro.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Introduction
2+
3+
C# is an elegant object-oriented language that enables developers to build a variety of powerful and secure applications.
4+
5+
It can be used to create Windows apps, Web services, Mobile apps, VR, Games and much more.
6+
7+
C# is a managed code, meaning that C# program requires and only executes under the management of a CLR (Common Language Runtime) virtual machine.
8+
9+
C# runs on the .NET framework just like the way Java runs on a JVM (Java Virtual Machine)

0 commit comments

Comments
 (0)