void wickedSunny(char* szBlog);

Monday, June 21, 2004

What is this .Net all about ?

'Exclusively for the people who have no idea about .net '

The simple answer is 'it is the technology from Microsoft, on which all other Microsoft
technologies will be depending on in future.'. It is a major technology change. Just like the computer world moved from DOS to Windows, now they are moving to .Net. But don't be surprised if you find anyone saying that "I do not like .Net and I would stick with the good old COM and C++". There are still lot of people who like to use the bullock-cart instead of the latest Honda car. :) .Net technology was introduced by MicroSoft, to catch the market from the SUN's Java. Few years back, MicroSoft had only VC++ and VB to compete with Java, but Java was catching the market very fast. With the world depending more and more on the Internet/Web and java related tools becoming the best choice for the web applications, Microsoft seemed to be loosing the battle. Thousands of programmers moved to java from VC++ and VB. This was alarming for MicroSoft and many of the MicroSoft fan's kept on asking "is Microsoft sleeping?". And MicroSoft had the answer. One fine morning, they announced : "We are not sleeping. We have the answer for you.". And that answer was .net. But Microsoft has a wonderful history of starting late but catching up quickly. This is true in case of .Net too. Microsoft put their best men at work for a secret project called Next Generation Windows Services (NGWS)., under the direct supervision of Mr. Bill Gates. The outcome of the project is what we now know as .NET. Even though .NET has borrowed most of it's ideas from Sun's J2EE, it has really outperformed their competitors.

Microsoft's VC++ was a powerful tool. But it was too complex. It has too many datatypes, and
developers had to learn many libraries including WIndows SDK, MFC, ATL, COM etc. There were many datatype compatibility issues while exchanging data between different layers. Visual Basic was too easy, and many serious programmers hated it just for that reason. Even though Visual basic was very easy to use, it was not very flexible to develop serious applications. SUN's Java became a very good choice for these reasons. It had the flixibility and power of C++ and at the same time easy enough to catch the attention of VB programmers. MicroSoft recognised these factors and they introducd the .Net considering all these factors. All unwanted complexities are eliminated and a pure object oriented programming model was introduced. This makes programmer's life very easy. .Net framework comes with a single class library. And thats all programmers need to learn!! Whether they write the code in C# or VB.Net or J#, it doesn't matter, you just use the .net class library. There is no classes specific to any language. There is nothing more you can do in a language, which you can't do in any other .Net language. You can write code in C# or VB.Net with the same number of lines of code, same performance and same efficiency, because eveyone uses same .net class library.

What is .Net ?

It is a platform neutral framework. Is a layer between the operating system and the programming language. It supports many programming languages, including VB.Net, C# etc. .Net provides a common set of class libraries, which can be accessed from any .net based programming language. There will not be separate set of classes and libraries for each language. If you know any one .net language, you can write code in any .net language!! In future versions of Windows, .net will be freely distributed as part of operating system and users will never have to install .net separately.

What is Not ?

.Net is not an operating system. .Net is not a programming language.
".Net is a framework" Are you confused by this definition? Well, that is OK. It is really confusing! :)We cannot define .net as a 'single thing'. It is a new, easy, and extensive programming platform. It is not a programming language, but it supports several programming languages. By default .net comes with few programming languages including C# (C Sharp), VB.Net, J# and managed C++. .Net is a common platform for all the supported languages. It gives a common class library, which can be called from any of the supported languages. So, developers need not learn many libraries when they switch to a different language. Only the syntax is different for each language. When you write code in any language and compile, it will be converted to an 'Intermediate Language' (MicroSoft Intermediate Language - MSIL). So, your compiled executable contains the IL and not really executable machine language. When the .Net application runs, the .Net framework in the target computer take care of the execution. (To run a .net application, the target computer should have .Net framework installed.) The .Net framework converts the calls to .net class libraries to the corresponding APIs of the Operating system. Whether you write code in C# or VB.Net, you are calling methods in the same .Net class libraries. The same .net framework executes the C# and VB.Net applications. So, there won't be any performance difference based on the language you write code.

What is Visual Studio.Net ?

Many people always get confused with Visual Studio .Net (VS.Net) and .Net technology. VS.Net is just an editor, provided by MicroSoft to help developers write .net programs easily . VS.Net editor automatically generates lot of code, allows developers to drag and drop controls to a form, provide short cuts to compile and build the application etc. VS.Net is not a required thing to do .net programming. You can simply use a notepad or any other simple editor to write your .net code!!! And you can compile your .net programs from the command prompt. Well, what I said is true theoretically.. but if you decide to use notepad for .net programming, by the time you develop few sample applications, MicroSoft would have introduced some other new technology and .net would be outdated. You may not want that. So, let us go by VS.net, just like every other .net guys.

.Net supported languages
Currently .net supports the following languages:

C#
VB.Net
C++
J#

The above languages are from MicroSoft. Many third parties are writing compilers for other
languages with .net support.

Difference between VB and VB.Net

Believe us, there is not much in common between VB and VB.net other than the name. VB.Net is a
totally new programming language. It just retains the syntax of old VB. So, if you are a vb programmer, probably you may like VB.net than C# just because of the syntax. In addition to this, VB.net still support many of the old VB functions just for backward compatibility. But if you are a serious .net programmer, we strongly suggest never use old VB functions in VB.Net. So, switching from VB to VB.Net is just like learning a new programming language, with very small similarities between them.

C# or VB.Net ? Which one to choose ?

As we mentioned in earlier chapters, it makes no much difference. Whether you write code in
VB.net or C#, when you compile, your code will get converted to MSIL (MicroSoft Intermediate
language). It is this MSIL which you deliver to your customer in the form of a DLL or EXE. The
MSIL is executed by the same .net framework, whether you wrote it originally in C# or VB.net.
The MSIL generated by C# and VB.net is almost 99% is the same! Many believe that C# has the power of C++ and VB.Net has the user friendliness of VB. That is not true. Both are equally powerfull and friendly.

VB.net has backward compatibility with old Visual basic. So, it supports old vb functions. C# is a fresh, clean language. So strongly support using C# instead of VB.net just for this clean
compiler. Many old VB guys usually like to stick with VB.net and are kind of scared of C#. We are sure that you will not take more than few days to get familiar with C# syntax. This online tutorial is based on C# and all samples will be provided in C#.

Is it platform independant ?
Many people ask this question "Java is platform independant, what about .net ?".
The answer is "Yes" and "No" !
The code you write is platform independant, because whatever you write is getting compiled into MSIL. There is no native code, which depends on your operating system or CPU. But when you execute the MSIL, the .net framework in the target system will convert the MSIL into native platform code.

So, if you run your .net exe in a Windows machine, the .net framework for Windows will convert it into Windows native code and execute. If you run your .net application in Unix or Linux, the .net framework for Unix/Linux will convert your code into Unix/Linux native code and execute. So, your code is purely platform independant and runs anywhere!
But wait, we said it wrong... there is no .net framework for Unix or Linux available from Micorsoft. MicroSoft has written the .net framework only for Windows.

For Linux there is a project under development by Novell which is making a .Net framework for linux and it is still in beta stage called as MONO.

Future of .Net

MicroSoft is moving all its technologies to be .Net based or .Net related. The next version of
SQL Server even supports writing stored procedures in .net languages. .Net runtime will be part of all Operating Systems by default.
In short, if you like to work on MicroSoft technologies for programming, .net would be the only choice you will have. :))

i say

The choice has already been made. u just have to accept it !
- The Architect .. Matrix - II

gfx_sikander

0 Comments:

Post a Comment

<< Home