Vous êtes sur la page 1sur 3

What is C#?

C# ( pronounced as C Sharp ) is the first language that has been designed from
ground up with Internet in mind. It is a concise, clean, and modern language that
combines the best features of many commonly used languages !", #a$a and C%%. &s
truly said it combines the power of C%% with producti$ity of !" and elegance of #a$a.
Wh
y C#
C# is a new programming language introduced with .'(). *ith C#, de$elopers who
prefer the elegance and conciseness of C+style synta,, or might already be familiar with
#a$a or C%%, can -uic.ly implement applications and components that support the .'()
/ramewor.. )hese are managed by the C01, and interoperate with components and
application written in other .'() aware languages.
)he C and C%% de$elopers face problems li.e memory lea.s, difficulty in writing
multithreaded applications, static lin.ing, illegal pointer references, o$erly comple,
multiple+inheritance rules, and so on. C# sol$es these problems. C# is better suited than
any other language for an en$ironment in which producti$ity, the Internet, and code+
reuse are o$erriding concerns.
History
)he history of C# begins early in 2345s when C was in$ented in which 6'I7 was
written. "ut C had some drawbac.s. )he power that C affords the programmer ma.es it
easy for him to blunder. /or e,ample, it allows the programmer to directly allocate
memory and permits him to deallocate this memory.
)hen came C%% in 2385s, who li.e its predecessor too. the world by a storm. 9espite it
being ob:ect+oriented C%% had some problems. !eteran programmers often had
problems migrating from C (structured) to C%% ( ob:ect+oriented ) because effecti$e C%%
programming re-uires a completely new mindset.
Sun created #a$a. )hey were moti$ated with the *orld *ide *eb. )hey sought a single
en$ironment that would target multiple platforms. ;rograms in #a$a are not compiled to
machine code, but instead to an intermediate language or bytecode that can be
e,ecuted on any computer e-uipped with a suitable interpreter program ()he #a$a
1untime).
)oday, <icrosoft un$eils an alternati$e strategy for bringing the de$elopment and web
worlds together and online with .'(). "ecause all .'() languages compile to a
common bytecode, a de$eloper can program in whiche$er language he wants and share
his wor.s with other de$elopers using other .'() languages.
=ere comes in C#, de$eloped by &nders =e:lsberg. )his is a language designed for
the .'() platform. C# promotes one+stop coding, the grouping of classes, interfaces
and implementations together in one file so that de$elopers can edit code more easily.
C# handles ob:ects in much the same way as #a$a i.e. $ia reference rather than $ia
pointers. &nother $irtue of C# ha$ing been in$ented recently, is that it is intrinsically
ob:ect+oriented and web+enabled.
The C#
Character Set

&lphabets
&, ", >.., ?, @
a, b, >>, y, A
9igits
5, 2, B, C, D, E, F, 4,
8, 3
Special Symbols
G H I # J K L M ( ) N
+ % O
P Q R S T U V W X Y , . Z
[

& character denotes any letter of the alphabet, digit or special symbol used to represent
information. /ollowing table shows the $alid letters, numbers and special symbols
allowed in C#
C#
Keywords
C# contains a rich set of 4F reser$ed .eywords. \eywords can be used as identifiers if
prefaced by an I.
)he .eywords are

abstract as base bool
brea. byte case catch
char chec.ed class const
continue decimal default delegate
do double else enum
e$ent e,plicit e,tern false
finally fi,ed float for
foreach goto if implicit
in int interface internal
is loc. long namespace
new null ob:ect operator
out o$erride params pri$ate
protected public readonly ref
return sbyte sealed short
siAeof stac.alloc static string
struct switch this throw
true try typeof uint
ulong unchec.edunsafe ushort
using $irtual $oid while
<any of these are surely not new to #a$a and C[C%% programmers
& few additional points to note about operators +
a. J ( .nown as the modulus operator ) gi$es the remainder and wor.s on floats or
reals too.
b. is and typeof are used to find the type of an ob:ect at run+time.
c. checked and unchecked are used to control how the compiler deals with
o$erflow conditions

Vous aimerez peut-être aussi