Getting started with SDK

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luke Skywalker

    #1

    Getting started with SDK

    Hi,

    Since my home machine is only a P3 800 and I don't want to get
    a new one until I really need to, I was wondering if someone knows of
    a good tutorial to get started learning about development in .Net.

    From what I read on MSDN and elsewhere, I understand that..

    - I just need the framework and the SDK (starting with 1.1, it seems
    like the SDK no longer includes the framework)

    - I can write basic apps in VB.Net or C# in notepad, and just feed the
    code to some precompiler that turns the code into language-neutral
    bytecode, which is then compiled by the CLR

    - the CLR can compile to native code or compile code on the fly (JIT)

    Am I correct? Can someone point me to the right direction to write a
    "Hello, world!" in VB.Net?

    Thank you
    Luke.
  • Morten Wennevik

    #2
    Re: Getting started with SDK

    Hi Luke,

    Not sure if you need Framework installed if you install the SDK (never
    tried in that order).
    You only need framework to be able to write .net programs in C# or
    vb.net. It includes the compilers and a bunch of other programs that may
    be handy at times. The SDK is great because without the helpfiles you
    wouldn't get very far. The SDK also includes a few other programs like
    ildasm.exe, the il disassembler for viewing .net executables.

    You typically write a codefile in notepad (or editor of choice). Then you
    compile it in a dos window

    csc.exe mycode.cs
    vb.exe mycode.vb

    This produces mycode.exe from a c# codefile called mycode.cs or vb file
    called mycode.vb.
    That is all there is to creating programs. Well, this would compile to a
    dos program flashing a dos box each time you fire up the program, even if
    it was a windows program.

    csc.exe /target:winexe mycode.cs

    This would create a windows program.

    As for a good site for learning to code in vb.net ... I suggest you do a
    search on google for vb.net tutorial or similar. You'll get plenty
    commercial hits and most are probably for visual studio, but you should be
    able to find a view free ones.

    I don't know much vb.net but in C# you could do hello world with

    class MyClass
    {
    // your program always needs a Main
    public static void Main()
    {
    System.Console. WriteLine("Hell o World");
    }
    }

    or for a windows program using a label

    class MyClass : System.Windows. Forms.Form
    {
    System.Windows. Forms.Label label1;

    // the constructor, called when you use 'new MyClass'
    public MyClass()
    {
    label1 = new System.Windows. Forms.Label();
    this.Controls.A dd(label1);

    label1.Text = "Hello World";
    }

    // this time in Main you attach a messageloop to a new MyClass object
    public static void Main()
    {
    System.Windows. Forms.Applicati on.Run(new MyClass());
    }
    }


    --
    Happy Coding!
    Morten Wennevik [C# MVP]

    Comment

    • Luke Skywalker

      #3
      Re: Getting started with SDK

      On Mon, 06 Dec 2004 11:54:54 +0100, "Morten Wennevik"
      <MortenWennevik @hotmail.com> wrote:[color=blue]
      >You typically write a codefile in notepad (or editor of choice). Then you
      >compile it in a dos window[/color]

      Thx a bunch :-) BTW, unless I'm mistaken, the VB.EXE or CSC.EXE
      produce bytecode, which is then interpreted at run time by the CRL.
      What about performance? Can the compilers be told to generate native
      code instead?

      Thx
      Luke.

      Comment

      • Morten Wennevik

        #4
        Re: Getting started with SDK

        On Mon, 06 Dec 2004 12:35:23 +0100, Luke Skywalker <luke@tatooine. planet>
        wrote:
        [color=blue]
        > On Mon, 06 Dec 2004 11:54:54 +0100, "Morten Wennevik"
        > <MortenWennevik @hotmail.com> wrote:[color=green]
        >> You typically write a codefile in notepad (or editor of choice). Then
        >> you
        >> compile it in a dos window[/color]
        >
        > Thx a bunch :-) BTW, unless I'm mistaken, the VB.EXE or CSC.EXE
        > produce bytecode, which is then interpreted at run time by the CRL.
        > What about performance? Can the compilers be told to generate native
        > code instead?
        >
        > Thx
        > Luke.[/color]

        vb.exe/csc.exe is the compiler and linker producing bytecode or IL
        (intermediate language).
        This bytecode is converted to native language by the clr when each new
        part of the program runs (not everything at once, only necessary parts,
        causing programs to start faster than say java bytecode)
        This native code will linger in memory causing subsequent starts of the
        program to run faster.

        You can force the bytecode to be compiled to native using ngen.exe but I'm
        a little unsure as to what this does exactly. And the native code
        programs should rarely be distributed as they are machine specific (I'm
        not even sure the native code is stored in the file).

        --
        Happy Coding!
        Morten Wennevik [C# MVP]

        Comment

        • Luke Skywalker

          #5
          Re: Getting started with SDK

          On Tue, 07 Dec 2004 09:33:32 +0100, "Morten Wennevik"
          <MortenWennevik @hotmail.com> wrote:[color=blue]
          >This native code will linger in memory causing subsequent starts of the
          >program to run faster.[/color]

          Mmm... So, it means that the original slow-down occurs every time the
          user launches the app, not just the very first time a program, or
          parts of it, is executed. I'll install the SDK and see how well apps
          run on a modest P3.

          Thx again
          Luke.

          Comment

          • Morten Wennevik

            #6
            Re: Getting started with SDK

            Don't worry, it's not that slow. I coded C# on a P2 350/Windows ME just
            fine last summer, although I did have 'plenty' memory on it (>300mb).

            On Tue, 07 Dec 2004 09:58:15 +0100, Luke Skywalker <luke@tatooine. planet>
            wrote:
            [color=blue]
            > On Tue, 07 Dec 2004 09:33:32 +0100, "Morten Wennevik"
            > <MortenWennevik @hotmail.com> wrote:[color=green]
            >> This native code will linger in memory causing subsequent starts of the
            >> program to run faster.[/color]
            >
            > Mmm... So, it means that the original slow-down occurs every time the
            > user launches the app, not just the very first time a program, or
            > parts of it, is executed. I'll install the SDK and see how well apps
            > run on a modest P3.
            >
            > Thx again
            > Luke.[/color]



            --
            Happy Coding!
            Morten Wennevik [C# MVP]

            Comment

            Working...