Monday, July 28, 2008

.NET talk: Visual Basic VS Visual Basic.NET

This is quite and old topic but you lose nothing for reading it. Since this due to my understanding based on my working experieance and some readings, I always welcome any response, whether to add or to correct the facts.

**************************************************************************************

Quite a number of friends keep asking me what are the differences between VB and VB.NET especially those who have some experiences on using Visual Basic. (VB6 or lower).

In this posting, I'll just focus on ONE difference.


Visual Basic is compiled language while Visual Basic.NET is interpreted language

Okay, if you first time heard "interpreted language" or "compiled language" maybe you want to read this. Briefly speaking, interpreted language is referred to the programming language which is interpreted line by line during runtime by an interpreter. Some other interpreted language which is very common today are PHP, PERL, JAVA and so on.

On the other hand, compiled language is a programming which is initially compiled to a native code also called machine code and object code. This program will later be run by the CPU directly without any further interpretation, C and C++ fall in this group. Some peaple might not really agree if I said VB.Net is interpreted instead of compiled. This reason might due to the fact that VB.Net itself actually compiled before executed (remember build and rebuild button in Visual Studio). You are correct - but the code is compiled to some intermediate code which microsoft call it CIL (stands for Common Intermediate Language, initially being called MSIL - stands for Microsoft Intermediate Language). This CIL works as similar as bytecodes for JAVA. Once, the code has been transferred to CIL. It will be later executed by Just In Time interpreter. That's one of two reason why before you can run any .NET application, it is a MUST to pre-install .NET Framework.

Now back to Visual Basic, after compiling the code to EXE, do you need to further install any translator? I don't think so (Please correct me if I'm wrong).

Next post, I'll talk about why VB.Net is running as interpreted instead of compiled.

No comments: