Showing posts with label C sharp.net. Show all posts
Showing posts with label C sharp.net. Show all posts

Monday, 11 April 2011

What is C#

C#

C# is one of programming languages which can be use to code .Net program. It is more popular because of its simple and clear syntax similar to C++ or java

C# is designed to be a platform-independent language in the tradition of Java. It's syntax is similar to C and C++ syntax, and C# is designed to be an object-oriented language. There are, for the most part, minor variations in syntax between C++ and C#. Main has no return type, there are no semicolons after class names, there are some (to C++ programmers) strange decisions regarding capitalization - such as the capitalization of Main. Other a few differences, the syntax is often the same. This decision is reasonable, in light of the fact that C syntax has been used with several other languages - notably Java.

The potential for C# is great if the .NET platform succeeds. C# is designed to take advantage of the design of .NET, and Microsoft has poured a great deal of money into .NET. Do you need to learn C#? If you know C++, you'll probably be able to pick it up quickly, and yes, you can still use C++ with .NET. It's important to keep an eye on C# to see how it will affect you.

While Microsoft and its competitors are always innovating and creating new ways to approach programming, about every ten years or so an approach so revolutionary comes along that it totally changes not only the way we program, but the way we think about programming.
In the early 1980s, the new technologies were Unix and a powerful new language called C. The early '90s brought Windows and C++. In 2000, .NET and C# were the next wave. Each of these developments represented a sea change in the way we approached programming.

The nasty little secret about .NET is that Microsoft really created only one language for the .NET platform. This language is called Microsoft Intermediate Language (MSIL). They then created two coatings for MSIL. One looks a lot like C++ or Java, and they named it C#; the other looks a lot like VB6 and they named it VB 2005. Both C# and VB 2005 produce MSIL, and it is MSIL that runs on the .NET platform.
C# 2.0 comes with updated tools and a powerful new development environment. It is the crowning achievement of Microsoft's R&D investment. And it is wicked cool. 

The .NET Platform

The .NET platform is a development framework that provides a new application programming interface (API) to the services and APIs of classic Windows operating systems while bringing together a number of disparate technologies that emerged from Microsoft during the late 1990s. This includes COM+ component services, a commitment to XML and object-oriented design, support for standardized protocols such as SOAP, WSDL, and UDDI, and a focus on the internet.
Since all .NET Common Language Specification compliant languages (like C#) produce MSIL, you can inherit from classes, catch exceptions, and take advantage of polymorphism across different .NET languages. The .NET Framework makes this possible with a specification called the Common Type System (CTS) that all .NET components must obey. For example, everything in .NET is an object of a specific class that derives from the root class called System.Object. The CTS supports the general concepts of classes, interfaces, and delegates (which support callbacks).

The CLR

The most important component of the .NET Framework is the Common Language Runtime (CLR), which provides the environment in which programs are executed. The CLR includes a virtual machine that creates, manages, secures and cleans up after objects. The CLR is a set of framework classes that include a layer for data (ADO.NET) and for XML. On top of all this, the CLR creates a layer for three types of applications: Windows desktop applications, web Applications and web services (see future article, "What Are Web Services?").
The classes that Microsoft provides to support these applications and to provide the "plumbing" for network operations, threading, database interaction, creating the user interface and so forth, are called the Framework Class Library (FCL). The .NET FCL is one of the largest class libraries in history; it provides an object model for all the functionality of the .NET platform. With more than 4,000 classes, the FCL facilitates rapid development of both desktop and web applications.

Why C#?

Many people believed that there was no need for a new programming language. Java, C++, Perl, Microsoft Visual Basic, and other existing languages were believed to offer all the functionality needed.
C# is a language derived from C and C++, but it was created from the ground up. Microsoft started with what worked in C and C++ and included new features that would make these languages easier to use. Many of these features are very similar to what can be found in Java. Ultimately, Microsoft had a number of objectives when building the language. These objectives can be summarized in the claims Microsoft makes about C#:
  • C# is simple.
  • C# is modern.
  • C# is object-oriented.
In addition to Microsoft's reasons, there are other reasons to use C#:
  • C# is powerful and flexible.
  • C# is a language of few words.
  • C# is modular.
  • C# will be popular.

What Can a C# Program Do?

Typical programming tasks includes putting data into a database or pulling it out, displaying high speed graphics in a game or video, controlling electronic devices attached to the PC or even playing music and/or sound effects. You can even write software to generate music or help you compose.
Some developers believe that C# is too slow for games, because it is interoperability. However the .NET runtime compiles the interpreted code (called CIL) the first time it is run.

Is There Plenty Of C# Open Source?

Not as much as in Java, C or C++ but it is starting to become popular. Unlike commercial applications, where the source code is owned by a business and never made available, open source code can be viewed and used by anyone. It's an excellent way to learn coding techniques.