By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,684 Members | 1,439 Online
Bytes IT Community
Submit an Article
Got Smarts?
Share your bits of IT knowledge by writing an article on Bytes.

What is .NET? Why do I need the Framework?

Expert 100+
P: 638
I have seen this question appear many times in the forums, so I am writing this to hopefully help those who have this question. First, a history lesson!

Your earlier languages compiled to assembly language. Typically for MS C++, this was the Pentium 4. Many processors could read this language, if not for a decrease in performance.

With .NET this changed. Now all .NET languages compile* into what was known as MSIL (Microsoft Intermediate Language) but is now known as CIL (Common Intermediate Language). Expect to hear either acronym, as they both mean the same thing. Whether its C#, VB .Net, C++ CLI, or even Delphi, they all compile to this language. What is this language? Its a pseudo assembly language.

This pseudo assembly language is unreadable by CPU's... so the .NET framework comes with another tool. The JIT (Just in Time) compiler. This is automatically ran when a program written in .NET is ran. It compiles ONLY the portion of the program you are using, hence, you could technically never compile portions of a program. Advantages? Disadvantages? Well, without going into too much detail, it boils down to this: It compiles to assembly language for the user's specific CPU, creating an increase in run time speed, although there is extra overhead to compile at runtime.

The other staple of .NET is the GC (Garbage Collection). Professed to be the end of memory leaks, the GC runs in the background constantly monitoring your program and cleaning up unused memory. How does this work? Well, it watches when and if you ever reference a variable, and when it is no longer referenced it releases it. While it does clean up a lot of the variables, there are still some specific instances that the programmer will have to clean up after themselves, but these are far fewer than ealier languages. This also adds to the overhead.

The final note I will touch upon with .NET is the libraries it incorporates. Many functions are already included with .NET and many programmers will find all they need within there. Very few functions have to be hard coded with WIM or other externals.

Many state that .NET programs run slower than their C++ counterparts and many state the opposite. Their arguement stems from the GC and JIT portions of .NET. Where as the JIT does compile a faster running assembly code, the program has more running in the background to keep it going. Do the benefits outweigh the results? Thats a question for another day, but know that the answer probably lies in 'depends.' It probably depends on the program and what it is doing.

*NGEN --
The Native Image Generator (NGEN) can create versions of .NET precompiled to Assembly Language, and if the processor can use it, it will over the JIT version of it. This still incorporates the GC though, but it is faster than the JIT for the specific processors it is compiled to.
Aug 1 '07 #1
Share this Article
Share on Google+

P: 2
good one for kids ..
Aug 5 '07 #2

Expert 100+
P: 638
good one for kids ..
Would you to care to elaborate?
Aug 6 '07 #3

P: 4
Thanks. Your explanation was very helpful for someone at my level, a newbie.

I believe that your intent was to be a generalized overview of .NET and in my opinion, relative to my level of experience, you hit the mark.

Aug 7 '07 #4

P: 18
hi TRIScheel...

It was very good article. It really matters to newbie like us..... ofcourse i dont see the reason why intelligent ppl (shival329 ) are wandering around in this forum since they know everything...

Once again...nice topic...

Sep 21 '07 #5

P: 2
This is very good information. keep write like this presentation..

some one will get an idea on Frame work
Sep 27 '07 #6

P: 4
awesome thing man very short and sweet too.
Oct 9 '07 #7

P: 27

Now I can see the big picture.
Oct 16 '07 #8