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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TRScheel
    Recognized Expert Contributor
    • Apr 2007
    • 638

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

    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.
  • shival329
    New Member
    • Aug 2007
    • 2

    #2
    good one for kids ..

    Comment

    • TRScheel
      Recognized Expert Contributor
      • Apr 2007
      • 638

      #3
      Originally posted by shival329
      good one for kids ..
      Would you to care to elaborate?

      Comment

      • Spledge
        New Member
        • Aug 2007
        • 4

        #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.

        S

        Comment

        • mady1380
          New Member
          • Sep 2006
          • 18

          #5
          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...
          Thanks

          mady

          Comment

          • mrindia
            New Member
            • Sep 2007
            • 2

            #6
            Hi,
            This is very good information. keep write like this presentation..

            some one will get an idea on Frame work

            Comment

            • toubuddy
              New Member
              • Oct 2007
              • 4

              #7
              awesome thing man very short and sweet too.

              Comment

              • phfle1
                New Member
                • Oct 2007
                • 27

                #8
                Thanks,

                Now I can see the big picture.

                Comment

                Working...