Sams Teach Yourself C in 21 Days

(singke) #1
Microsoft says that C# brings the power of C++ with the ease of Visual Basic. C# does
bring a lot of power, but is it as easy as Visual Basic? It might not be as easy as Visual
Basic 6, but it is as easy as Visual Basic .NET (version 7), which was rewritten from the
ground up. The end result is that Visual Basic is really no easier than programming C#.
In fact, you can actually write many programs with less code using C#.
Although C# removes some of the features of C++ that cause programmers a lot of grief,
no power or functionality was really lost. Some of the programming errors that are easy
to create in C++ can be totally avoided in C#. This can save you hours or even days in
finishing your programs.

Types of C# Programs ........................................................................................


It is worth knowing what types of applications you can create with C#. There are a
number of types you can build:


  • Console applications.Console applications run from the command line.
    Throughout this book you will create console applications, which are primarily
    character- or text-based and therefore remain relatively simple to understand.

  • Windows applications.You can also create Windows applications that take advan-
    tage of the graphical user interface (GUI) provided by Microsoft Windows.

  • Web Services. Web services are routines that can be called across the Web.

  • Web Form / ASP.NET applications.ASP.NET applications are executed on a
    Web server and generate dynamic Web pages.
    In addition to these types of applications, C# can be used to do a lot of other things,
    including creating libraries, creating controls, and more.


Creating a C# Program

There are a few editors available for C#. Microsoft has added C# capabilities to its Visual
Studio product which includes Visual C# .NET. This is the most predominant editor

770 Bonus Day 7

The top questions on Internet discussion forums related to .NET are


  • What is the difference between Java and C#?

  • Isn’t C# just a Java clone?

  • What is the difference between C# and C++?

  • Which should I learn, Visual Basic.NET or C#?


Note


42 448201x-Bonus7 8/13/02 11:24 AM Page 770

Free download pdf