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. The Lounge
  3. Why does C# programmers use

Why does C# programmers use

Scheduled Pinned Locked Moved The Lounge
questioncsharpc++com
25 Posts 16 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.
  • C Chris Maunder

    I'm with you, Konstantin. Superflous this's make me shudder. I will probably be scorned by the masses, but I'm going to continue using 'm_' prefixes for my member variables. cheers, Chris Maunder

    A Offline
    A Offline
    Atlantys
    wrote on last edited by
    #21

    it's all about the "m_" ;P it just makes sense.

    1 Reply Last reply
    0
    • G G Suresh

      It is rather nice to use 'this' if you are not using the Hungarian notation. You can readily distinguish members. Another reason is that you get Intellisense support for members of the current class. Regards, Suresh

      R Offline
      R Offline
      Russell Morris
      wrote on last edited by
      #22

      G. Suresh wrote: Another reason is that you get Intellisense support for members of the current class. True, but I've found that you can get the same thing by always prefixing your member variables with the 'm_' wart. Then, when you want to reference one, type 'm_' and then hit Ctrl+Spacebar, and IntelliSense will pop up. These days I can hit Ctrl+Space almost as fast as Alt+F+S :) -- Russell Morris "WOW! Chocolate - half price!" - Homer Simpson, while in the land of chocolate.

      1 Reply Last reply
      0
      • G G Suresh

        It is rather nice to use 'this' if you are not using the Hungarian notation. You can readily distinguish members. Another reason is that you get Intellisense support for members of the current class. Regards, Suresh

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #23

        The only names that can clash in C# are function arguments and member variables... right? Then it's very easy to spot which names are local to the member and which are local to the object/class. And "this" could very well be replaced with "m_", then there is no ambiguity (and less to type as well!) just m_ away :) Sonorked as well: 100.13197 jorgen FreeBSD is sexy.

        1 Reply Last reply
        0
        • C Chris Maunder

          I'm with you, Konstantin. Superflous this's make me shudder. I will probably be scorned by the masses, but I'm going to continue using 'm_' prefixes for my member variables. cheers, Chris Maunder

          J Offline
          J Offline
          Jorgen Sigvardsson
          wrote on last edited by
          #24

          I'm with you all the way... Sonorked as well: 100.13197 jorgen FreeBSD is sexy.

          1 Reply Last reply
          0
          • J Jarek G

            Its a standard notation in oop languages a specially in Java and C# you are using namespacing in c# and in your namespace you might have some int or.. that have the same name but don't belong to the class?? The other thing is when you using this. you get intelihelp from Visual Studio :-) /Jarek "Imagination is more important than knowledge, for knowledge is limited while imagination embraces the entire world." -Albert Einstein

            J Offline
            J Offline
            Jorgen Sigvardsson
            wrote on last edited by
            #25

            Jarek Gibek wrote: Its a standard notation in oop languages a specially in Java and C# I don't buy that. OOP is a methodology, and syntax is just a way to express it. This excessive use of "this" is just too much noice. Jarek Gibek wrote: you are using namespacing in c# and in your namespace you might have some int or.. that have the same name but don't belong to the class?? IIRC the only instance names that can clash in C# are member variables and function arguments. So I don't see how you can mistake a variable name for another (except for the member/function argument case). Jarek Gibek wrote: The other thing is when you using this. you get intelihelp from Visual Studio Ok, I'll buy that. But I'll bet you a million that "m_" is faster to type than "this." :) Sonorked as well: 100.13197 jorgen FreeBSD is sexy.

            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