Lesson 1.1 Hello World
The "Hello World" example program is a tried and tested starting point. It is rolled out for almost every instructional piece of coding literature ever, and with good reason. It is a shortcut to show how easy it is for you to affect a result from the computer.
It also shows in short form, you are in control of the computer. Given the nature of the machine is to intimidate. In fact, this is the crux of coding. Its reason is to put you in control. The fact is that the computer has a bewildering array of things it can do for you. It’s this which can turn people off. C#, as with almost all languages, is an attempt to rationalize this. There’s only so much it can do though and coding languages are a compromise between allowing you to do the most obscure and powerful operations and to be able to work easily and conveniently.
The hello world program code is shown below. Firstly, don’t panic. It is a fairly daunting chunk of text to the uninitiated. To explain it all in full detail would be to digress too far at this point. I have simply highlighted the lines of the code that we care about. They are also the lines that are executed by the program when it is run.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("Hello World");
System.Console.ReadKey(true);
}
}
}
If you run the program it fires off a window as shown below.

Press any key to close the program. That’s it, simple isn’t it? You’ve just run your first C# program. You can have a lie down in a minute if you like.
How did we accomplish this ground breaking bit of functionality? The program essentially does two things. The first is to write the text to the screen.
System.Console.WriteLine("Hello World!");
This writes it to a system component called the console. In this example, that’s basically the screen to you and me. If you want to try changing the text, feel free to alter what’s between the quotes.
The second part of the operation waits for you to press something.
System.Console.ReadKey(true);
Programs are quite subservient and will close and kill themselves once they have done their task. If this line wasn’t there then it would close the screen and you would barely be able to see the inspired words appear on your monitor. What a loss! To see what I am getting at, you can delete this line and re-run the program.