Skip to content

Commit 7b80513

Browse files
hey-mikeyaminoxixPanquesito7
authored
adding c# language (#84)
* adding c# language * Update lang/csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> * Update lang/csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> * Update lang/csharp.md Co-authored-by: David Leal <halfpacho@gmail.com> * Update lang/csharp.md Co-authored-by: David Leal <halfpacho@gmail.com> * Update lang/csharp.md Co-authored-by: David Leal <halfpacho@gmail.com> * Update lang/csharp.md Co-authored-by: David Leal <halfpacho@gmail.com> * Update lang/csharp.md Co-authored-by: David Leal <halfpacho@gmail.com> * Update lang/csharp.md Co-authored-by: David Leal <halfpacho@gmail.com> * Update lang/csharp.md Co-authored-by: David Leal <halfpacho@gmail.com> * Update lang/csharp.md Co-authored-by: David Leal <halfpacho@gmail.com> * Update lang/csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> * Update lang/csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> * Update lang/csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> * Update lang/csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> * Update lang/csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> * Update lang/csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> * Update lang/csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> * Update lang/csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> * Update lang/csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> * added command * Update csharp.md Co-authored-by: Anshumaan Kumar Prasad <75872316+amino19@users.noreply.github.com> Co-authored-by: David Leal <halfpacho@gmail.com>
1 parent 1cfb259 commit 7b80513

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

lang/csharp.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
lang: C#
3+
syntax: cs
4+
title: Why do Java programmers have to wear glasses? Because they don’t C#.
5+
author: hey-mikey
6+
---
7+
8+
```cs
9+
public class HelloWorld {
10+
public static void Main(string[] args) {
11+
Console.WriteLine("Hello, World!");
12+
/* this keeps the console open instead of
13+
* printing the line and immediately closing.
14+
*/
15+
Console.ReadLine();
16+
}
17+
}
18+
```
19+
20+
## 🤔 What is C#?
21+
22+
- C# is a language developed by Microsoft in 2000 to address the growing interest in web applications. It was written by Anders
23+
Hejlsberg, who also worked on Turbo Pascal and Delphi.
24+
- It's useful for desktop applications as well as mobile and cross-platform applications, too.
25+
- With the Unity game engine, developers can also create games with C#
26+
27+
## 📈 Why to use C#?
28+
29+
- C# is remarkably scalable and easy to maintain.
30+
- It's good for beginners, especially beginners with experience with Java or C++ because the code syntax is very similar
31+
- It's possible to write applications for desktop, web, mobile, games, and cross-platform with C#. Cool stuff!
32+
- C# is statically-typed and easy to read, and it's object-oriented, another thing it has in common with Java.
33+
- [According to a 2020 StackOverflow study](https://insights.stackoverflow.com/survey/2020#technology-most-loved-dreaded-and-wanted-languages-loved), C# is an in-demand skill and among the top ten languages used.
34+
35+
## 🛠️ Setting up C# development environment
36+
37+
### 💻 To use on Linux or macOS
38+
39+
To start building .NET apps, download and install the [.NET SDK (Software Development Kit)](https://download.visualstudio.microsoft.com/download/pr/8a504918-9508-464d-80c6-4da7f9cc9ac6/f9d6ad00bbd798bafb549101b5b4a4c0/dotnet-sdk-5.0.402-win-x64.exe)
40+
41+
Once you've installed, open a new command prompt and run the following command:
42+
```sh
43+
dotnet
44+
```
45+
If you receive a 'dotnet is not recognized as an internal or external command' error, make sure you opened a new command prompt.
46+
47+
In the command prompt again, write
48+
```sh
49+
dotnet new console -o myApp
50+
```
51+
then navigate to that directory
52+
```sh
53+
cd myApp
54+
```
55+
The main file in the myApp folder is Program.cs. By default it's already written to print "Hello World!" to the Console.
56+
57+
### 📎 Using it on Windows
58+
59+
1. Download and install the free version of [Visual Studio](https://visualstudio.microsoft.com/downloads).
60+
2. Open Visual Studio, and choose "Create a new project" in the Start window.
61+
3. Choose `C#` from the Language list.
62+
4. Choose `Windows` from the platform list.
63+
5. Choose `Console` from the project types list.
64+
6. Once your new project loads, you can add `.cs` files or edit the existing automatically-included `.cs` file.
65+
66+
## ✏️ Popular C# IDEs/Editors
67+
68+
- [Visual Studio Code](https://code.visualstudio.com/download)
69+
- [Visual Studio](https://visualstudio.microsoft.com/downloads)
70+
- [JetBrains Rider](https://www.jetbrains.com/rider)
71+
72+
## 🆒 Some cool projects in C#
73+
74+
- [The Roslyn .NET compiler](https://github.com/dotnet/roslyn)
75+
- [Google's Material Design for C#](https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit)
76+
- [TheAlgorithms/C#](https://github.com/TheAlgorithms/C-Sharp)
77+
78+
## 🚀 Conclusion
79+
80+
C# is a very flexible and beginner-friendly language, and it's used in a multitude of contexts from the web to desktop to mobile gaming. It's not difficult to get started with C#, and it will allow you to create a wide variety of projects and applications. Sky's the limit!
81+
82+
**Thanks for reading ✨**

0 commit comments

Comments
 (0)