C# MASTER

C# Basics

Back to Table of Contents

Basically, the C# language took many of the good things of JavaTM and improved on them. The C# language is a object oriented programming language that is designed for all sorts of Applications and programs that are removed from the underlying hardware so they can be moved to any operating System that has a Common Language Infrastructure CLI.

Now the Common Language Infrastructure is not written in the C# language, but is written in a lower level language, such as C or C++. The CLI handles the low level details so that C# programmers do not have to deal with those issues. All CLIs of all platforms and all C# compilers must conform to the specifics of the C# language and the CLI set forth by the C# Language Specification (download Ecma-334.pdf) and the Common Language Infrastructure (download Ecma-335.pdf). One such opensource implementation that runs on all platforms is Mono.

On each of these platform, C# code should produce the same result for a same C# applications. The CLIs on the other hand, are programmed in many different ways in different low level languages to achieve this uniformity across platforms.

This gives the C# Programmer the ability to program in code to do his specific tasks, unhindered by those low level concerns which is why the C# language can be learned faster than C or C++ and the C# programmer is a lot more efficient and faster in developing products than is C or C++ contemporaries.

One Advantage the Java language has that makes it so powerful is that it is strongly typed. That means that all data in the form of objects and value types are of exact types, like char, byte, int, String, StringBuilder. This makes C# powerful because it gives the programmer absolute control over the form that the data is in. Click here for a list of primitive types.

In many other languages, type is variable, depending on how the data unit is used. But not in the C# language. In the C# language, every variable name is of a specific type: either of a primitive type or an Object.

Also, there are a set of words that cannot be used as variable names, because they have a special meaning in the language, such as 'return' and 'void'. Click here to view these keywords, which include the simple value datatypes.

The C# language has single inheritance from child class to base class, and multiple inheritance from interfaces. This is an improvement over C++'s attempt at object-oriented programming, which has multiple inheritance from child class to base classes. Inheritance is covered in the Inheritance page.

*OracleTM and JavaTM are registered trademarks of Oracle and or its affiliates. Other names may be trademarks of their respective owners.*