Why C#?


To start, this was the first language I learned and it grew on me. I kept playing with it for a very long time, and it was easy to work with since Microsoft’s Visual Studio made life a lot easier. I’ve made games, windows apps, and console apps with it. Its beauty comes from its simplicity and how its easy to understand. Although many people argue that Java is bigger and this and that, C# is also in use in Windows App SDK’s in making apps for Windows Phone. Some even make Android and IOS apps with this language.

The thing is, C# and Java are almost, in both syntax and design, the same. If I wanted to work with Java then I would have (as I am right now figuring out the Android SDK).

I have also toyed around with C++ and made a few console apps, but thats just it. I knew how to work with it since most of the syntax is very similar to C# (albeit a few multiple things). It never grew on me though, since C# had prettty much the same characteristics as C++ (not everything though), and it was a lot more clearer, and just any other OOP language, I can use classes, inheritance, abstraction, polymorphism, etc…

If you wanted to compare them, then just go here: http://msdn.microsoft.com/en-us/library/yyaad03b%28v=vs.71%29.aspx

Basically, with the ability of Visual Studio’s designer, the simplicity of the language and what I’m able to do with it have all contributed to making C# my choice language.

So if anyone is curious on how a simple Hello World command prompt program looks like, here:

using System;

 

//our namespace

namespace Program

{ 

// A "Hello World!" program in C#
class Program //A class called Program, Ok. 
{
   static void Main()//Our Main method/function to enter our code in 
   {
      Console.Write("Hello World!");

      //Console.Write prints the message onto the command prompt

      //Console.WriteLine does the same too, except once the message is printed...

      //the cursor moves to a new line

 

      Console.ReadLine();//This keeps the window open, to basically read the message. 

   }
}

} 

//Notes...

//Main() can return 0 (as in the number value 0), or it can return void (as in nothing).

//In a simple Hello World program in C# like this one, you dont need to return 0 like in C++.

//Only return an integer if the method/function has a return type like int, double, byte, etc... 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s