Skip to content

Latest commit

 

History

History
79 lines (60 loc) · 3.35 KB

csharp.md

File metadata and controls

79 lines (60 loc) · 3.35 KB
lang syntax title author
C#
cs
C# can be used to create almost anything but is particularly strong at building Windows desktop applications and games.
hey-mikey
public class HelloWorld {
    public static void Main(string[] args) {
        Console.WriteLine("Hello, World!"); 
        Console.ReadLine(); 
    }
}

🤔 What is C#?

  • C# is a language developed by Microsoft in 2000 to address the growing interest in web applications. It was written by Anders Hejlsberg, who also worked on Turbo Pascal and Delphi.
  • It's useful for desktop applications as well as mobile and cross-platform applications, too.
  • With the Unity game engine, developers can also create games with C#

📈 Why to use C#?

  • C# is remarkably scalable and easy to maintain.
  • It's good for beginners, especially beginners with experience with Java or C++ because the code syntax is very similar
  • It's possible to write applications for desktop, web, mobile, games, and cross-platform with C#. Cool stuff!
  • C# is statically-typed and easy to read, and it's object-oriented, another thing it has in common with Java.
  • According to a 2020 StackOverflow study, C# is an in-demand skill and among the top ten languages used.

🛠️ Setting up C# development environment

💻 To use on Linux or macOS

To start building .NET apps, download and install the .NET SDK (Software Development Kit)

Once you've installed, open a new command prompt and run the following command:

dotnet

If you receive a 'dotnet is not recognized as an internal or external command' error, make sure you opened a new command prompt.

In the command prompt again, write

dotnet new console -o myApp

then navigate to that directory

cd myApp

The main file in the myApp folder is Program.cs. By default it's already written to print "Hello World!" to the Console.

📎 Using it on Windows

  1. Download and install the free version of Visual Studio.
  2. Open Visual Studio, and choose "Create a new project" in the Start window.
  3. Choose C# from the Language list.
  4. Choose Windows from the platform list.
  5. Choose Console from the project types list.
  6. Once your new project loads, you can add .cs files or edit the existing automatically-included .cs file.

✏️ Popular C# IDEs/Editors

🆒 Some cool projects in C#

🚀 Conclusion

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!

Thanks for reading ✨