Programming Lessons: Let's learn a little of C# - Lesson 01

Words
202
Reading
1 min
Listen
Play
9y

Hello Guys


Today I bring a new topic. I wanna teach how to program a little. As you probably know I'm a software developer so I wanna bring some of the stuff that I do daily. With this topic I do not wanna do something hard to understand but the basic concepts of programming.

We'll start with a simple topics and the language that we'll use is C#.

About C#

C# is a simple, modern, general-purpose, object-oriented programming language developed by Microsoft within its .NET initiative led by Anders Hejlsberg. This tutorial covers basic C# programming and various advanced concepts related to C# programming language.

First of all, if you wanna try the examples that I'll provide you can use this site to program online C#. Alternatively, you can install the free version on Visual Studio, the best tool to program C# here.

asd.jpg


Image Source

Lesson 01: Hello World

You can find this example everywhere but it's a classic so I'm using it to teach one of the simple method of C#. The first example is the code to display a message "Hello World" in a console.

Code


// Allow include the System namespace in the program.
using System;

// Namespace declaration. A _namespace_ is a collection of Classes.
namespace HelloWorldApp
{
     // Class declaration
     class HelloWorld
     {
          // Main method, which is the entry point for all C# programs.
          static void Main(string[] args)
          {
               // WriteLine is a method of the Console class defined in the System namespace.
               Console.WriteLine("Hello World");

               // Makes the program wait for a key press
               Console.ReadKey();
          }
     }
}

Console


> Hello World
Press a key to continue...
Hope you enjoy the first lesson :) criptomaster@criptomaster
Programming Lessons: Let's learn a little of C# - Lesson 01 | Ecency