December 1, 2013

C# overview : What you need to know

In the previous post, we saw how to kick start a C# program on Visual Studio. That was nice and really easy. In this post, we will tour and know about C# in general.

C# is a programming language developed by Microsoft for its .NET platforms. If you are familiar with any languages before, like C, C++ or Java or JavaScript; syntactically they are all similar. There's a common notion in programming world that if you learn any language by heart (preferably C/C++), then you will get a very big leap if you wish to learn any other language like C# or Java or PHP.

C# is a managed code environment. If you are familiar with developing for C or C++, you might have encountered the problem with managing resources like memory, where you have to explicitly free the memory once you are done with your program. In C#, the memory management is automatic, much like Java.

Perhaps the most important of all, C# is an Object-Oriented Programming language. Almost everything is treated as an object. We will learn about objects in future.

C# is a foundation language that works with many different Microsoft platform and technologies. At the heart of whatever magical happening inside your C# program, there is something called the Common Language Runtime (CLR). This is basically the execution engine that converts the bytes of program that got compiled from the C# program. You may also think of it as Virtual Machine if you are familiar with Java. This is what that runs your code.
On top of that, we have the Microsoft .NET Framework Libraries. The .NET is basically a bunch of code, bundled in a library that performs some common tasks, like getting user input, displaying output, making web requests etc.
At the very top, we have our C#. But the interesting part is, not only can C# get access to use the wonderful world of .NET, languages like VB.NET, Python and others can also use .NET libraries.

So whats the catch? The ultimate goal is to develop something, right? By learning C#, you can prepare yourself for application development on Windows platforms like Windows desktop, Windows 8 Store Apps, Windows Phone etc. You can also build websites if you learn ASP.NET. You can also develop games for Xbox. All of these comes under your umbrella if you learn C# and other associative things.

C# goes back down the history since 2001. What we see today is through some iterative developments on this platform. Currently available is .NET 4.5.

If you have seen the first program from the previous post, you will notice something called namespace. .NET actually uses namespace to manage or organize group of classes that are related. The several lines at the top of each C# program indicates the namespaces or group of classes that we are going to use in our program. As for example, using System; statement indicates that the bunch of classes under the System namespace will be used in this program. In our previous post, we have used the Console class to do something for us. If you are curious enough now, you can see this link. In the course of time, we will take a look at some of them.

No comments:

Post a Comment