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 Conventions

Naming Conventions

Scheduled Pinned Locked Moved C#
csharptutorialquestion
9 Posts 4 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.
  • G Offline
    G Offline
    Ganjah786
    wrote on last edited by
    #1

    Hi ppl. What sort of naming standards should you use for C#? Should variable names in the class start with "m_str" for example? thanks

    E S 2 Replies Last reply
    0
    • G Ganjah786

      Hi ppl. What sort of naming standards should you use for C#? Should variable names in the class start with "m_str" for example? thanks

      E Offline
      E Offline
      eggie5
      wrote on last edited by
      #2

      This is what microsoft dictates... Naming Guidelines[^] I think your sopposed to use pascal case for variables and no little prefix.... /\ |_ E X E GG

      C G 2 Replies Last reply
      0
      • G Ganjah786

        Hi ppl. What sort of naming standards should you use for C#? Should variable names in the class start with "m_str" for example? thanks

        S Offline
        S Offline
        Stefan Troschuetz
        wrote on last edited by
        #3

        Take also a look at this site[^] from MSDN. It should give you a general overview before studying the previous posted link. www.troschuetz.de

        1 Reply Last reply
        0
        • E eggie5

          This is what microsoft dictates... Naming Guidelines[^] I think your sopposed to use pascal case for variables and no little prefix.... /\ |_ E X E GG

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          eggie5 wrote: This is what microsoft dictates Well, Microsoft don't really dictate it, they are called "guidelines" because you can ignore them if you wish. But, obviously if everyone follows the guidelines it becomes easier to maintain and read the code.


          "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way! My Blog

          E 1 Reply Last reply
          0
          • C Colin Angus Mackay

            eggie5 wrote: This is what microsoft dictates Well, Microsoft don't really dictate it, they are called "guidelines" because you can ignore them if you wish. But, obviously if everyone follows the guidelines it becomes easier to maintain and read the code.


            "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way! My Blog

            E Offline
            E Offline
            eggie5
            wrote on last edited by
            #5

            Like on Pirates of the Caribbean? /\ |_ E X E GG

            C 1 Reply Last reply
            0
            • E eggie5

              Like on Pirates of the Caribbean? /\ |_ E X E GG

              C Offline
              C Offline
              Colin Angus Mackay
              wrote on last edited by
              #6

              :laugh: Kind of... :-D


              "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way! My Blog

              1 Reply Last reply
              0
              • E eggie5

                This is what microsoft dictates... Naming Guidelines[^] I think your sopposed to use pascal case for variables and no little prefix.... /\ |_ E X E GG

                G Offline
                G Offline
                Ganjah786
                wrote on last edited by
                #7

                I notice there is no more use of the prefix for the type of the variable anymore. I'm use to using a variable named say "strName" to say the type is a string. Wouldn't the use of just "Name" be a little confusing if you didn't know its type just by looking naming standard for all you know it could be a integer, boolean (hopefully not!)?

                E 1 Reply Last reply
                0
                • G Ganjah786

                  I notice there is no more use of the prefix for the type of the variable anymore. I'm use to using a variable named say "strName" to say the type is a string. Wouldn't the use of just "Name" be a little confusing if you didn't know its type just by looking naming standard for all you know it could be a integer, boolean (hopefully not!)?

                  E Offline
                  E Offline
                  eggie5
                  wrote on last edited by
                  #8

                  If you are using visual studio or any other ide, you can tell my just leaving your mouse over the variable and it will give you all that info... /\ |_ E X E GG

                  G 1 Reply Last reply
                  0
                  • E eggie5

                    If you are using visual studio or any other ide, you can tell my just leaving your mouse over the variable and it will give you all that info... /\ |_ E X E GG

                    G Offline
                    G Offline
                    Ganjah786
                    wrote on last edited by
                    #9

                    no more notepad then :-)

                    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