Monday 27 February 2012

Introduction to C#


C Sharp (programming language)

C# is an object-oriented programming language developed by Microsoft as part of the .NET initiative and later approved as a standard by ECMA and ISO . Anders Hejlsberg leads development of the C# language, which has a procedural, object-oriented syntax based on C++ and includes influences from aspects of several other programming languages (most notably Delphi and Java) with a particular emphasis on simplification.

History

During the development of .NET, the class libraries were originally written in a language called Simple Managed C (SMC). In January 1999, Anders Hejlsberg formed a team to build a new language at the time called Cool. By the time the .NET project was publicly announced at the July 2000 Professional Developers Conference (PDC), the language had been renamed C# and the class libraries and ASP.NET runtime had been ported to C#.

C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg, who was previously involved with the design of Visual J++, Borland Delphi, and Turbo Pascal. In interviews and technical papers he has stated that flaws in most major programming languages (e.g. C++, Java, Delphi, and Smalltalk) drove the fundamentals of the Common Language Runtime (CLR), which, in turn, drove the design of the C# programming language itself.

Design goals

The ECMA standard lists these design goals for C#:
  • C# is intended to be a simple, modern, general-purpose, object-oriented programming language.
  • Because software robustness, durability and programmer productivity are important, the language should include strong type checking, array bounds checking, detection of attempts to use uninitialized variables, source code portability, and automatic garbage collection.
  • The language is intended for use in developing software components that can take advantage of distributed environments.
  • Programmer portability is very important, especially for those programmers already familiar with C and C++.
  • Support for internationalization is very important.
  • C# is intended to be suitable for writing applications for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions.
Versions
1.0, 1.5, 2.0 (ECMA), 3.0

Features

C# differs from C and C++ in many ways, including:
  • There are no global variables or functions. All methods and members must be declared within classes. It is possible, however, to use static methods/variables within public classes instead of global variables/functions.
  • Multiple inheritance is not supported, although a class can implement any number of interfaces. This was a design decision by the language's lead architect to avoid complication.
  • Full type reflection and discovery is available.

Features of C# 2.0

New features in C# for the .NET SDK 2.0 (corresponding to the 3rd edition of the ECMA-334 standard) are:
  • Partial classes allow class implementation across more than one source file. This permits splitting up very large classes.
  • Generics or parameterized types.
  • Static classes that cannot be instantiated, and that only allow static members. This is similar to the concept of module in many procedural languages.
  • Anonymous delegates.
  • The accessibility of property accessors can be set independently.
  • Nullable value types which provides improved interaction with SQL databases.
  • Coalesce operator: (??) returns the first of its operands which is not null (or null, if no such operand exists):

Features of C# 3.0

C# 3.0 is the current version, and was released on 19 November 2007 as part of .NET Framework 3.5. It includes new features inspired by functional programming languages such as Haskell and ML, and is driven largely by the introduction of the Language Integrated Query (LINQ) pattern to the Common Language Runtime.[9]
 C# 3.0 was unveiled at the 2005 Professional Developers Conference. It is not currently standardized by any standards organisation, though it is expected that it will eventually become an ECMA and then ISO standard, as did its predecessors.

Criticism

Performance 
C# programs, like all programs written for the .NET and other virtual machine environments such as Java, tend to require more system resources than functionally similar applications that access machine resources more directly.

Platform 
Microsoft's current .NET implementation is only available on Windows.

No comments:

Post a Comment