Results 1 to 4 of 4

Thread: .net

  1. #1
    Join Date
    Nov 2002
    Posts
    2,231
    Rep Power
    0

    Question .net

    [preparing for imminent beatdown after making this post]
    Ok so i am not exactly a programming guru (C, C++, html, xhtml, javascript and a little vbscript) and ive been hearing ppl talk about .net for a while and ive been ignoring it thinking its just, well... something i could ignore. But recently since ive been teaching maself asp and i came into the asp forums i see alot of ppl posting about .net and i remembered that almost all the languages have some .net ting going on sooooo basically....

    WAT THE HECK IS .NET!!!!! is it a whole new language? is a patch to an existing language? Do i have to learn it? Can i continue ignoring it?

    [/preparing for imminent beatdown after making this post]
    Laptop: HP DV6700t - Core 2 Duo T9300 2.5Ghz, 3GB RAM, Nvidia 8400m GS, 250GB HDD. Ubuntu 12.04 and Windows 7
    Phone: Samsung Galaxy Nexus

  2. #2
    Join Date
    Oct 2004
    Posts
    4,814
    Rep Power
    24

    Default

    To simple put it withoput going into a long explanation. .Net is very similar to the java platform. Code is compiled MSIL ( Microsoft intermediate language) which is equivalent java bytecodes. The only thing diffrent is that .Net supports multiple languages. This means that any and all .Net supported langauge will eventually compile to MSIL. This has several advantages.

    1. The abliltiy to use reuse code written in another .net language in another .net language. For example I could write a class in C# compile it and be able to inherit from that class in vb.net

    2. Since the MSIL is machine independed it is possible to run MSIL code on several platforms. As long as the platform has a engine to understand the MSIL (think of the java virtual machine). Its posible to run .net programs on Linux using Mono.

    So you see it is nothing new. Its basically a copy of Java. As for you learning .net I say I would'nt hurt to.

    Btw there is only one new language available on the .net platform and thats C# (CSharp). However Vb and vb.net are fundamentally different in many areas so are the other older languages. Im sure If you looked up info on .net you'll find far greater info.
    Last edited by leoandru; Nov 12, 2005 at 09:44 PM.

  3. #3
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Seconding Leo's answer

    The .Net Framework is MS next generation platform for programming and it brings together different languages and developers to a common runtime environment.

    On Windows XP CD, you have an option to install the .Net Framework 1.0 (a bunch of dlls). This allows you to run .Net programs or even compile a new program using cs.exe. As Leo said code is compiled to MSIL. ASP.Net is a part of it too and that allows the ASP server to run compiled code from the asp pages. Once you have a .Net Framework with ASP.Net installed on Win2000, WinXP or Vista then you can run any of the .Net Programs including ASP applications, just like Virtual Machine.

    The .Net Framework is like a collection of classes, or a library. What is really cool about it is that the library is very large and well documented. The C# Langauge is cool too, it allows you to use the library. You would have to try it for youself to understand how cool. Visual Studio 2002 and up may be needed to fully apreciate it.

    If I say it is not necessary to learnt it I would first say that it is not difficult to learn. My opinion is that C# has some syntax differnce from C++ and some code running difference. The .Net library is similar to other object oriented libraries and any difference is an addition or improvement! I think the .Net Framework is here to stay for that reason. Eg 10 years from now, you could be writing code that uses the library even if the runtime of the library is completely overhauled. It is as non-Windows specific as an MS library can be. Plus with the addition of classes to handle xml and web services, and supported languages, it is worth looking at especially for ASP web forms and applications. The cost is that you will have to learn either C#/VB.Net/J# or something.
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  4. #4
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Here is a simple example of a C# code that uses classes in the .Net Framework. It is supposed to be a window form that has 3 text fields and one button.
    [Find Text:]
    [Replace Text:]
    [Paragraph:]
    [Replace Button]
    The user enters text in the appropriate fields and clicks the replace button and your basic find and replace occurs. I left out some of the code for simplicity.
    Code:
    //Two Framework namespaces which encapsulate classes by category
    using System;                 //This has the classes like String
    using System.Windows.Forms;   //This has the classes like Button and TextBox
    
    namespace FileRenamer
    {
        //A window form that inherits from the Form class
        public class FormFileRenamer : System.Windows.Forms.Form
        {
            //You should recognise this part. There are 3 text boxes and one button on the form.
            private System.Windows.Forms.TextBox  txtFindText;
            private System.Windows.Forms.TextBox  txtReplaceText;
            private System.Windows.Forms.TextBox  txtParagraphText;
            private System.Windows.Forms.Button   butReplace;
    
            public FormFileRenamer()
            {
                //Initialize code
                //like setting the caption on the button, the size of the text fields,
                //setting up the event handlers, etc
            }
    
            private void butReplace_Click(object sender, System.EventArgs e)
            {
                //Find the text in the paragraph and replace it with a new text
                String  strTemp  =    txtParagraphText.Text.Replace(this.txtFindText.Text, this.txtReplaceText.Text);
                txtParagraphText.Text    =    strTemp;
                //This same code could run on an asp web page with minor modification.
                //The ASP server would do the replace when the form is submitted.
                //Forget that this is bad practice since you should use JScript so that the client does the work instead
            }
    }
    And here is a link to the classes in the .Net framework
    .NET Framework Class Browser
    Last edited by crosswire; Nov 13, 2005 at 01:15 PM.
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •