15.02.2015 Views

C# 4 and .NET 4

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

53<br />

<strong>C#</strong>, Visual Basic, C++/Cli, <strong>and</strong> f#<br />

WhaT ’ s in This ChaPTer<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

Namespaces<br />

Defi ning types<br />

M e t h o d s<br />

Arrays<br />

Control statements<br />

Loops<br />

Exception h<strong>and</strong>ling<br />

Inheritance<br />

Resource management<br />

Delegates<br />

Events<br />

Generics<br />

LINQ queries<br />

C++/CLI mixing native <strong>and</strong> managed code<br />

<strong>C#</strong> is the programming language designed for .<strong>NET</strong>. More than 50 languages exist for writing .<strong>NET</strong><br />

applications — for example, Eiffel, Smalltalk, COBOL, Haskell, Pizza, Pascal, Delphi, Oberon,<br />

Prolog, <strong>and</strong> Ruby. Microsoft alone delivers the languages <strong>C#</strong>, Visual Basic, C++/CLI, J#, JScript.<strong>NET</strong>,<br />

<strong>and</strong> F#.<br />

Every language has advantages <strong>and</strong> disadvantages; some things can be done easily with one language<br />

but are complicated with another one. The classes from the .<strong>NET</strong> Framework are always the<br />

same, but the syntax of the language abstracts various features from the framework. For example,<br />

the <strong>C#</strong> using statement makes it easy to use the objects implementing the IDisposable interface.<br />

Other languages need more code for the same functionality.<br />

The most commonly used .<strong>NET</strong> languages from Microsoft are <strong>C#</strong> <strong>and</strong> Visual Basic. <strong>C#</strong> was newly<br />

designed for .<strong>NET</strong> with ideas from C++, Java, Pascal, <strong>and</strong> other languages. Visual Basic has its roots<br />

in Visual Basic 6 <strong>and</strong> was extended with object - oriented features for .<strong>NET</strong>.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!