Results 1 to 5 of 5

Thread: C# Starting out

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Resolved C# Starting out

    What are the naming conventions defined by .Net? I haven't had a chance to look at the API but from the code below im assuming that all methods follow X or XxxxXxxx. Also can the Main thread of execution take arguements? Thanks.
    Code:
     using System;
     class Hello{
      static void Main() {
       Console.WriteLine("Hello, World");
      }
     }

  2. #2
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Re: C# Starting out

    Methods should follow that, there are coding conventions you can find on microsoft.com and others. Main, MyMethod etc., not main or myMethod. Of course they don't have to, you can name however you want.

    Just modify your code like so to grab the args:
    Code:
    static void Main(string[] args)

  3. #3

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Re: C# Starting out

    I haven't looked at really any C# code except for a few snippets but from the code i looked at it looks like the api types have to be defined in lowercase. Is this correct?

  4. #4

  5. #5
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fort Collins, CO
    Posts
    366

    Re: C# Starting out

    Your best bet is the Design Guildelines for Class Library Developers on Microsoft's site. These are strictly guidelines though, upper case and lower case variations depend on who's doing the coding.

    But from the looks of it, your machine is not fast enough and you do not have enough ram, video, and hard disk space to be able to follow any guidelines, so good luck

    I work with ex-Java developers though who write C# code like Java. Don't do that!

Posting Permissions

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



Click Here to Expand Forum to Full Width