C# Programming, Lesson 0: Installing Visual Studio
Firstly, Well done on choosing C# as your next learning goal.
But why C#?
C# (pronounced see sharp) is a general-purpose, multi-paradigm programming language encompassing strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.[16] It was developed around 2000 by Microsoft as part of its .NET initiative, and later approved as an international standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270:2018). Mono is the name of the free and open-source project to develop a compiler and run-time for the language. C# is one of the programming languages designed for the Common Language Infrastructure (CLI) [Wikipedia].
Get you tools first -> Install Microsoft Visual Studio
Microsoft Visual Studio is a full-featured integrated development environment (IDE) for Android, iOS, Windows, web, and cloud.
Step 1: Go to: https://visualstudio.microsoft.com/downloads/
Download the free version of VS (Visual Studio) for community.
Step 2: install VS same as you do with any other software, just follow easy and friendly instructions by the installer.
Step 3: Now you are ready to start the programming journey. Open VS as your usual procedure with other software
From here, you can create a new project, or open one that you already have. Click Create a new project to program one from scratch.
The easiest start for beginners is to work with Console Applications, which basically run on a console window (similar to that black command line window).
Give your project a name, such as "MyApp1", then proceed...
Now we will code our first program!
You will find something similar to the below, except the statements I added in the Main method. You need not to worry about any thing. For now, ALL of your code should be placed within the Main method.
Press F5 to test and run your code (the code in copy-able text is below).
You'll see the test printed in the output console window. Wow!
Let us not analyze the important parts of the code inside the Main { } method:
- Comments are placed with "//". Comments are for our own usage, and they will not be executed.
- C# complete sentence must end with a semi-colon ";". You must never forget that.
- Console.WriteLine is the method/function used to print out some text/strings.
- Text is enclosed with quotation marks such as "Text".
- Console.ReadLine() reads input from user (e.g. key strokes or enter key) to avoid auto-closure of condole window.
All the best!
Here is the code in plain text
---------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyApp1
{
class Program
{
static void Main(string[] args)
{
// write something to the console window
Console.WriteLine("Hello! I made my first programming task, Yay!");
// read line from use to avoid auto-window closure
Console.ReadLine();
}
}
}
---------------
Comments
Post a Comment