C# - A language for .Net
The C# language was designed by Microsoft (tm) for its new .NET platform.
It is a descendant of C++ with features coming from Java and various other
languages.
C# will not be the sole language used on .Net, many other languages are
implemented also and they will work concurrently on the platform and share
objects, this include C++, Pascal, Python, Java, and lot of other with even
Cobol and Fortran. All these languages will be embedded also inside HTML
pages as ASP.
Features
C# compiles into intermediate language, the MSIL (MicroSoft Intermediate Language), and uses a multi-language library, the CLR (Common Language Runtime).
- Structs of C++ are special objects passed by value.
- A property allows to use methods as variables.
- The foreach() construct allows to scan arrays.
- Delegate replaces pointers on functions used by C.
- Operators overloading exists but for the "=" one.
- Fully object oriented, even primitive and constants are object.
- Indexers are invisible methods to access arrays with security.
- The language may access the native environment, unlike Java.
- The -> operator of C++ is replaced by a dot.
Why to use C Sharp?
C# is easier to use than C++. But programs require the CLR runtime of .net
to be installed. You can convert you C++ code with no difficulty. It will
be cross-platform. You can mix languages on the .net platform and use C#
along with any language.
Not usable to distribute software for now.
Sites and tools
Official
site for .NET and C#.- Mono
.NET compatible platform including a C# compiler. - Compiler
A CSharp compiler is provided freely by Microsoft, as a part of Visual Studio Express. - Visual
C# Express
It is a true RAD (Rapid Application Development) by Microsoft. Windows or console applications or libraries. - Silverlight
Using XAML on the Web. - Turbo
C#
RAD tool, with visual interface and predefined widgets, free even for commercial software building. Makes use of the Microsoft compiler. - XNA
Game development tool based on C#.
Sample code
|
Merging and displaying lists
|
string s = "demo" + "trail";
foreach (char c in s)
{
System.Console.WriteLine(c);
}
|
