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. Other Discussions
  3. Clever Code
  4. Did I St-St-Stutter?

Did I St-St-Stutter?

Scheduled Pinned Locked Moved Clever Code
csharpasp-netsysadminhelpquestion
26 Posts 16 Posters 319 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.
  • S Sorys P

    IMHO Hungarian notation used to make sense in ancient times when IDEs didn't provide information about the type and you had to navigate through code to find it. Don't get me wrong, I used it as well. A real problem with Hungarian notation begins when you decide to change the type and forget that the name has to be changed as well. How many times have you worked with code of someone who actually forgot to change the name? It's not only misleading, it's irritating. Personally I use these naming conventions not only in my .Net code but in C/C++ as well.

    modified on Tuesday, July 26, 2011 2:33 AM

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

    Did you see the section on "Controls on Forms"? Looks like a mild form of Hungarian notation. Instead of naming after the particular control type, looks like the recommendation on that page is to name it after its function (e.g., field, label, command). That solves the issue of changing control type, at least for the most part (so if you change your control from a textbox to a RichTextBox, "BiographyField" is still a valid name). I like that.

    Martin Fowler wrote:

    Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

    S 1 Reply Last reply
    0
    • A AspDotNetDev

      Did you see the section on "Controls on Forms"? Looks like a mild form of Hungarian notation. Instead of naming after the particular control type, looks like the recommendation on that page is to name it after its function (e.g., field, label, command). That solves the issue of changing control type, at least for the most part (so if you change your control from a textbox to a RichTextBox, "BiographyField" is still a valid name). I like that.

      Martin Fowler wrote:

      Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

      S Offline
      S Offline
      Sorys P
      wrote on last edited by
      #22

      Glad you like it. Before I found this article few years ago, I used Hungarian for controls. I use the "ux" prefix as well. It really makes life easier when you have all your controls in one place when IntelliSense window pops out.

      1 Reply Last reply
      0
      • A AspDotNetDev

        <asp:PlaceHolder runat="server" ID="phPhone">
        (Code to Insert Phone Number)
        </asp:PlaceHolder>

        I still use hungarian notation when naming ASP.NET server controls. I hope my coworkers don't think I have a speech im... imp... imped... a speech problem.

        Martin Fowler wrote:

        Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

        W Offline
        W Offline
        wizardzz
        wrote on last edited by
        #23

        This is your phone. This is your phPhone on acid.

        "I have a theory that the truth is never told during the nine-to-five hours. " — Hunter S. Thompson My comedy.

        1 Reply Last reply
        0
        • G Gary R Wheeler

          Hungarian notation is an abomination before God.

          Software Zen: delete this;

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

          Good thing I'm an atheist then. :laugh:

          -- Kein Mitleid Für Die Mehrheit

          G 1 Reply Last reply
          0
          • J Jorgen Sigvardsson

            Good thing I'm an atheist then. :laugh:

            -- Kein Mitleid Für Die Mehrheit

            G Offline
            G Offline
            Gary R Wheeler
            wrote on last edited by
            #25

            Hungarian notation is an abomination before all-sentient-life-regardless-of-personal-belief-system. FTFY.

            Software Zen: delete this;

            1 Reply Last reply
            0
            • A AspDotNetDev

              Performance is a feature. You shouldn't sacrifice performance (where it is actually important) for better readability. However, you should still strive to make the code as understandable (and readable) as possible.

              Martin Fowler wrote:

              Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

              T Offline
              T Offline
              Tech Code Freak
              wrote on last edited by
              #26

              Exactly! It's very truly said! :thumbsup:

              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