The Supplied Languages


The .NET Framework is supplied with four languages (Visual Basic .NET, Visual C#, Visual J#, and JScript.NET), but the whole infrastructure is designed to be language independent. We'll briefly discuss some alternative languages you can use, later in the chapter. The factored and open design of ASP.NET, which enables pluggable HTTP modules, also extends to the CLR, enabling pluggable languages.

As mentioned in the previous chapter, the compilers section of the machine.config file defines the languages in use:

  <compilers>   <compiler language="c#;cs;csharp" extension=".cs"   type="Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.5000.0,   Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="1"/>   <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb   type="Microsoft.VisualBasic.VBCodeProvider, System, Version=1.0.5000.0,   Culture=neutral, PublicKeyToken=b77a5c561934e089"/>   <compiler language="js;jscript;javascript" extension=".js"   type="Microsoft.JScript.JScriptCodeProvider, Microsoft.JScript,   Version=7.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>   <compiler language="VJ#;VJS;VJSharp" extension=".jsl"   type="Microsoft.VJSharp.VJSharpCodeProvider, VJSharpCodeProvider,   Version=7.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>   </compilers>  

Thus, anyone can supply a language for use in the .NET Framework, as long as it has a compiler and conforms to a few basic rules. Later in the chapter, we'll look at the other languages supplied by third parties.

What Happened to VBScript?

The .NET Framework supports Visual Basic, so VBScript support has been dropped. Visual Basic provides everything that VBScript supplied, and far more. While VBScript has indeed gone, the syntax is still supported, but you now get full compilation, data types, and the added benefits of the new language. So if you've only ever used VBScript, don't worry “ there will be a little adjusting to do, but for the most part you'll find using Visual Basic .NET simple.

Visual Studio or Notepad?

Most people assume that to use Visual Basic .NET or C# in your ASP.NET pages, you need Visual Studio .NET, but that isn't the case. Support for the languages is built into the CLR, and the compilers are available as part of the SDK. Thus, to write ASP.NET applications, all you need is the ( freely available) SDK and your favorite editor (great news if, like me, you're a die-hard Notepad user ). For compilation there's a standalone compiler for each language (described in The .NET Language Compilers section later in the chapter), so you can compile components from the command line.

Visual Studio .NET is far more than just an editor. It provides a rich environment for developing both ASP.NET applications (Web Forms) and Windows applications (Windows Forms), with all the usual cool features such as drag and drop, statement completion (Intellisense), debugging, and so on. As a productivity tool, it's great, but it's not forced on you if you don't want it.

Further, the open design of the .NET languages enables third parties to produce alternative editors with support for .NET.




Professional ASP. NET 1.1
Professional ASP.NET MVC 1.0 (Wrox Programmer to Programmer)
ISBN: 0470384611
EAN: 2147483647
Year: 2006
Pages: 243

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