Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Naming Rules

Naming Rules

Scheduled Pinned Locked Moved C#
csharpvisual-studiohelp
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Adriaan Davel
    wrote on last edited by
    #1

    Hi, I'm looking for the (class / property / etc) naming rules in c#. I thought 'surely the language specification must have them' and 'surely Google can tell me', problem is I keep finding naming conventions etc etc. I need the RULES, e.g. You may not start a property name with a number. The stuff that makes the compiler break... I don't care about upper case vs lower case etc, those are conventions...

    ____________________________________________________________ Be brave little warrior, be VERY brave

    B P L K 4 Replies Last reply
    0
    • A Adriaan Davel

      Hi, I'm looking for the (class / property / etc) naming rules in c#. I thought 'surely the language specification must have them' and 'surely Google can tell me', problem is I keep finding naming conventions etc etc. I need the RULES, e.g. You may not start a property name with a number. The stuff that makes the compiler break... I don't care about upper case vs lower case etc, those are conventions...

      ____________________________________________________________ Be brave little warrior, be VERY brave

      B Offline
      B Offline
      Bigdeak
      wrote on last edited by
      #2

      Hello, you may look for design patterns. There are not only the rule for class names, the design patterns are really good for common design stuff. For example: If you want to implement a undo/redo feature to you application, the Memento pattern ist the right. Here is a list of more design patterns: Design Patterns

      A 1 Reply Last reply
      0
      • B Bigdeak

        Hello, you may look for design patterns. There are not only the rule for class names, the design patterns are really good for common design stuff. For example: If you want to implement a undo/redo feature to you application, the Memento pattern ist the right. Here is a list of more design patterns: Design Patterns

        A Offline
        A Offline
        Adriaan Davel
        wrote on last edited by
        #3

        Hi, thanks for your reply but I am not looking for design patterns (I am familiar with a vast array of them already), I'm looking for a definitive list of rules for naming in c#

        ____________________________________________________________ Be brave little warrior, be VERY brave

        B 1 Reply Last reply
        0
        • A Adriaan Davel

          Hi, I'm looking for the (class / property / etc) naming rules in c#. I thought 'surely the language specification must have them' and 'surely Google can tell me', problem is I keep finding naming conventions etc etc. I need the RULES, e.g. You may not start a property name with a number. The stuff that makes the compiler break... I don't care about upper case vs lower case etc, those are conventions...

          ____________________________________________________________ Be brave little warrior, be VERY brave

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          You might find the ECMA Spec for C# useful. It's available here[^].

          I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

          My blog | My articles | MoXAML PowerToys | Onyx

          1 Reply Last reply
          0
          • A Adriaan Davel

            Hi, I'm looking for the (class / property / etc) naming rules in c#. I thought 'surely the language specification must have them' and 'surely Google can tell me', problem is I keep finding naming conventions etc etc. I need the RULES, e.g. You may not start a property name with a number. The stuff that makes the compiler break... I don't care about upper case vs lower case etc, those are conventions...

            ____________________________________________________________ Be brave little warrior, be VERY brave

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Another alternative is on MSDN[^] :)

            I are Troll :suss:

            1 Reply Last reply
            0
            • A Adriaan Davel

              Hi, thanks for your reply but I am not looking for design patterns (I am familiar with a vast array of them already), I'm looking for a definitive list of rules for naming in c#

              ____________________________________________________________ Be brave little warrior, be VERY brave

              B Offline
              B Offline
              Bigdeak
              wrote on last edited by
              #6

              Ah, i thought design patterns would be ah good basis how to name classes at least. Sorry if my answer couldn't help you.

              1 Reply Last reply
              0
              • A Adriaan Davel

                Hi, I'm looking for the (class / property / etc) naming rules in c#. I thought 'surely the language specification must have them' and 'surely Google can tell me', problem is I keep finding naming conventions etc etc. I need the RULES, e.g. You may not start a property name with a number. The stuff that makes the compiler break... I don't care about upper case vs lower case etc, those are conventions...

                ____________________________________________________________ Be brave little warrior, be VERY brave

                K Offline
                K Offline
                Kythen
                wrote on last edited by
                #7

                See section 2.4.2 Identifiers of the CSharp Language Specification available from MSDN at http://msdn.microsoft.com/en-us/library/ms228593.aspx[^] Generally speaking, identifiers must start with a letter or underscore and can follow with almost any unicode character. If the identifier is a keyword, it must be prefixed with an '@' character.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups