So What Is C?


So What Is C#?

Microsoft and Sun both offer similar platforms with similar goals. Sun offers the JVM (with the JCL), and Microsoft offers the CLR (with the BCL). Where they differ in focus is in the role of the languages.

Sun offers Java as the language for their platform. It's possible for other languages to compile to Java byte codes and work with the JVM, but Sun doesn't endorse those efforts. They strongly believe that if you're going to use the JVM, you should program in Java.

Microsoft calls its virtual machine the Common Language Runtime because it believes that you shouldn't be tied down to a single language to work with its framework. Microsoft wants all the major compilers (C++, Visual Basic, Java, COBOL, etc.) to compile their code to IL so that they work with the CLR. In other words, BYOL ”"bring your own language." You use the language of your choosing, and if the vendor of that language compiles the source to IL, then you can work in the Microsoft Framework.

Some 30 language compilers are being changed to generate IL in order to work with the .NET Framework. This is good because you aren't tied down to one language. The main languages at the moment for .NET are C# and VB.NET. So if you're interested in job security you will probably want to learn one of those two languages or both.

As I noted above, C# is derived from C++ and has the look and feel of Java. It follows the C++ syntax in the way that you declare classes, declare functions, declare variables , write loops , derive classes from others, etc. It's also case sensitive. But it's a much simpler version of C++. It doesn't have pointers (unless you use unsafe code, which is hardly ever needed); it uses single inheritance (a class can only derive from at most one other class), which eliminates some of the headaches of inheritance; it doesn't have macro support, which a lot of experienced C++ developers detested; and it doesn't have template support, which actually many C++ developers miss , but did complicate programming a bit.

C# is a very compelling language for a number of reasons.

  • Microsoft submitted the language to ECMA for standardization, and it officially became a standard in December 2001, which means other companies can write compilers for it.

  • Most of the BCL classes were actually written in C#.

  • There is a lot of documentation for C# and some would argue that there's more documentation for C# than for the other .NET languages.

  • It's a cool new language, with a lot of Microsoft marketing effort behind it.

The other main language for the .NET Framework is Visual Basic.NET, which uses the syntax of older versions of Visual Basic and has been greatly changed to account for all the object-oriented features of the BCL. Before .NET came along, there were many more VB developers than C++ developers ” as many as 4 million registered users, compared to about 2 million for C++. Both C# and VB compile to IL, so in terms of performance, they are mostly the same.

Some VB developers argue that because VB.NET is so different from previous versions of VB, that if learning VB.NET takes the same amount of effort as learning C# ” and Microsoft is pushing C# heavily ”why not just learn C#?

It will be interesting to see in the future which language becomes the main development language for the framework.



C#
C# & VB.NET Conversion Pocket Reference
ISBN: 0596003196
EAN: 2147483647
Year: 2003
Pages: 198
Authors: Jose Mojica

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net