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. Hungarian Notation in .Net - Yes or No?

Hungarian Notation in .Net - Yes or No?

Scheduled Pinned Locked Moved The Lounge
csharpc++rubybeta-testingtools
90 Posts 42 Posters 8 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.
  • V Vikram A Punathambekar

    :) I too went to .NET from a Win32/MFC background, and found it strange - userName instead of strUserName felt awkward at first, but now it's the other way round. Besides, if you were to continue using Hungarian, your variable names would clash savagely with the framework's names (and others' ;) ). I'll tell you what I do not like about the .NET naming conventions, though - I think camelCase is way better for method names. [ducks]

    John Simmons / outlaw programmer wrote:

    the ORCAS Beta 2 is so transiently reliable

    I'd never install MS (or for that matter, most) betas. Unless the client wanted something to be oh-so-ready for the future.

    Cheers, Vıkram.


    After all is said and done, much is said and little is done.

    B Offline
    B Offline
    Brady Kelly
    wrote on last edited by
    #47

    Vikram A Punathambekar wrote:

    I'll tell you what I do not like about the .NET naming conventions, though - I think camelCase is way better for method names. [ducks]

    You better duck! :suss:

    1 Reply Last reply
    0
    • realJSOPR realJSOP

      I recently posted a C# article and as a C++ programmer is wont to do, I used hungarian notation on all my variables. This has generated a bit of discussion in the comments for the article, and not wanting to be completely close-minded about it, I decided to google it. Here's what I've found so far: 0) It seems that Microsoft thinks we should abandon it in favor of "more natural english-like" variable names. The best response to that statement was this little gem: "If Microsoft said I shouldn't comment my code, it wouldn't stop me from doing that, either." I could not have said it better myself. Maybe this outlook by Microsoft is why Vista is such garbage, or why the ORCAS Beta 2 is so transiently reliable. Just because some self-important evangelist from Microsoft says it doesn't make it gold. Translation - this claim is pretty weak. This is from Microsoft's coding guidelines: Use names that describe a parameter's meaning rather than names that describe a parameter's type. Development tools should provide meaningful information about a parameter's type. Therefore, a parameter's name can be put to better use by describing meaning. Use type-based parameter names sparingly and only where it is appropriate. It looks to me like they're putting the emphasis on reading code squarely on the end user instead of the developer. Hello!? We're programmers, and we can't be bothered by trying to figure out what type a variable is supposed to be. Sure, code should be easy to read, but that trait is introduced with meaningful variable and function names, not by removing ancillary information about the variables being used. 1) If you change the variable's type, it all of a sudden invalidates the name of the variable. Ever heard of Find/replace (with case matching and whole word turned on)? Besides, I can count on one hand how many times I changed the type of a variable in the last 18 years of C++ work. 2) Puts an emphasis on the type instead of the descriptive identifier name—encourages poor variable names. Ummm, how can a single lowercase character move the emphasis from the following variable name to the type itself. Further, hungarian notation in no way promotes the creation of "poor variable names". I can't recall ever hearing a programmer say, "Yep, using hungarian notation so that means I can skimp on the rest of the variable name." There are other equally invalid reasons put forth by all manner of know-it-alls, but I got bored typing this stuff. ------

      A Offline
      A Offline
      Andy Brummer
      wrote on last edited by
      #48

      Here's a blog post from one of the early C# team members. http://blogs.msdn.com/ericgu/archive/2007/02/01/properties-vs-public-fields-redux.aspx[^] If you are writing a library that will get used by a number of different languages, all the hungarian notation is ugly and confusing. If your code isn't going to be public for some level of public, just do what makes everyone happy.


      This blanket smells like ham

      1 Reply Last reply
      0
      • N Nemanja Trifunovic

        IMHO, it is sad that people waste so much energy on trivialities. Hungarian or not - who cares, as long as you use it consistently. The use of brain-damaged .NET 1.x collections is a much graver sin than any style issue one could imagine.


        Programming Blog utf8-cpp

        B Offline
        B Offline
        Brady Kelly
        wrote on last edited by
        #49

        Nemanja Trifunovic wrote:

        brain-damaged .NET 1.x collections

        What do you mean by that? The non-generic ones?

        D 1 Reply Last reply
        0
        • G Gary Kirkham

          John Simmons / outlaw programmer wrote:

          more natural english-like

          Looks like the Negus has infiltrated Microsoft.

          Gary Kirkham Forever Forgiven and Alive in the Spirit He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot Me blog, You read

          B Offline
          B Offline
          Brady Kelly
          wrote on last edited by
          #50

          That's where he's been, under cover!

          1 Reply Last reply
          0
          • J jhwurmbach

            In that case, the code snippet would be so short that the declaration would be immediatly above it. All in all - both your and James R. Twines argument seems a little far fetched to me.


            Failure is not an option - it's built right in.

            J Offline
            J Offline
            James R Twine
            wrote on last edited by
            #51

            You have to consider that different people work in different situations, and have different experiences.  Some people go through their lives never needing a gun, some have never had to wade through 100KB+ of source code (single file!) trying to resolve merge conflicts, and some have never had to code using VI over a 1200 baud serial terminal server connection.    Remember - just because you cannot see a reason for something does not mean that others may not know different (or better).  Tools are great, do not get me wrong, but they do not take the place of well-written code.  Done correctly, I believe that notations (prefixing or just "good naming") goes a long way here.    Peace!

            -=- James
            Please rate this message - let me know if I helped or not! * * * If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
            Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
            See DeleteFXPFiles

            1 Reply Last reply
            0
            • realJSOPR realJSOP

              I recently posted a C# article and as a C++ programmer is wont to do, I used hungarian notation on all my variables. This has generated a bit of discussion in the comments for the article, and not wanting to be completely close-minded about it, I decided to google it. Here's what I've found so far: 0) It seems that Microsoft thinks we should abandon it in favor of "more natural english-like" variable names. The best response to that statement was this little gem: "If Microsoft said I shouldn't comment my code, it wouldn't stop me from doing that, either." I could not have said it better myself. Maybe this outlook by Microsoft is why Vista is such garbage, or why the ORCAS Beta 2 is so transiently reliable. Just because some self-important evangelist from Microsoft says it doesn't make it gold. Translation - this claim is pretty weak. This is from Microsoft's coding guidelines: Use names that describe a parameter's meaning rather than names that describe a parameter's type. Development tools should provide meaningful information about a parameter's type. Therefore, a parameter's name can be put to better use by describing meaning. Use type-based parameter names sparingly and only where it is appropriate. It looks to me like they're putting the emphasis on reading code squarely on the end user instead of the developer. Hello!? We're programmers, and we can't be bothered by trying to figure out what type a variable is supposed to be. Sure, code should be easy to read, but that trait is introduced with meaningful variable and function names, not by removing ancillary information about the variables being used. 1) If you change the variable's type, it all of a sudden invalidates the name of the variable. Ever heard of Find/replace (with case matching and whole word turned on)? Besides, I can count on one hand how many times I changed the type of a variable in the last 18 years of C++ work. 2) Puts an emphasis on the type instead of the descriptive identifier name—encourages poor variable names. Ummm, how can a single lowercase character move the emphasis from the following variable name to the type itself. Further, hungarian notation in no way promotes the creation of "poor variable names". I can't recall ever hearing a programmer say, "Yep, using hungarian notation so that means I can skimp on the rest of the variable name." There are other equally invalid reasons put forth by all manner of know-it-alls, but I got bored typing this stuff. ------

              S Offline
              S Offline
              Shog9 0
              wrote on last edited by
              #52

              I hate hungarian notation. Hate, hate, hate, hate... The fact that seven years of coding on a team where it was The Standard have made it almost a habit for me just makes me hate it even more. The original idea was ok: tag variables with codes that indicate what sort of data it will be used for - not a basic compiler-defined type, something that actually makes sense in the app. But that was decades ago, and in the meantime we gained compilers that deal nicely with concise functions, and editors that can make code pretty and easy to read. And so it hangs around, extra baggage for those skilled enough to actually use it right, and yet another opportunity for the lazy to trip us up by throwing any old prefix onto variables. With .NET, Microsoft finally told the Hungarian to hit the road, hired some real programmers, and ditched the madness. It is, quite possibly, my second-favorite .NET feature.

              You must be careful in the forest Broken glass and rusty nails If you're to bring back something for us I have bullets for sale...

              P 1 Reply Last reply
              0
              • C Chris Maunder

                It takes a bit of getting used to but I far prefer non-hungarian notation now. I thought there would be problems with getting mixed up with types but by using sensible names (eg startDate, memberId, typeName) it's obvious as to the vague type you would expect to find in the variable

                cheers, Chris Maunder

                CodeProject.com : C++ MVP

                P Offline
                P Offline
                Paul Conrad
                wrote on last edited by
                #53

                Chris Maunder wrote:

                hungarian notation

                Now that's a notation I have not used in a long, long, long time :)

                "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                S 1 Reply Last reply
                0
                • realJSOPR realJSOP

                  I recently posted a C# article and as a C++ programmer is wont to do, I used hungarian notation on all my variables. This has generated a bit of discussion in the comments for the article, and not wanting to be completely close-minded about it, I decided to google it. Here's what I've found so far: 0) It seems that Microsoft thinks we should abandon it in favor of "more natural english-like" variable names. The best response to that statement was this little gem: "If Microsoft said I shouldn't comment my code, it wouldn't stop me from doing that, either." I could not have said it better myself. Maybe this outlook by Microsoft is why Vista is such garbage, or why the ORCAS Beta 2 is so transiently reliable. Just because some self-important evangelist from Microsoft says it doesn't make it gold. Translation - this claim is pretty weak. This is from Microsoft's coding guidelines: Use names that describe a parameter's meaning rather than names that describe a parameter's type. Development tools should provide meaningful information about a parameter's type. Therefore, a parameter's name can be put to better use by describing meaning. Use type-based parameter names sparingly and only where it is appropriate. It looks to me like they're putting the emphasis on reading code squarely on the end user instead of the developer. Hello!? We're programmers, and we can't be bothered by trying to figure out what type a variable is supposed to be. Sure, code should be easy to read, but that trait is introduced with meaningful variable and function names, not by removing ancillary information about the variables being used. 1) If you change the variable's type, it all of a sudden invalidates the name of the variable. Ever heard of Find/replace (with case matching and whole word turned on)? Besides, I can count on one hand how many times I changed the type of a variable in the last 18 years of C++ work. 2) Puts an emphasis on the type instead of the descriptive identifier name—encourages poor variable names. Ummm, how can a single lowercase character move the emphasis from the following variable name to the type itself. Further, hungarian notation in no way promotes the creation of "poor variable names". I can't recall ever hearing a programmer say, "Yep, using hungarian notation so that means I can skimp on the rest of the variable name." There are other equally invalid reasons put forth by all manner of know-it-alls, but I got bored typing this stuff. ------

                  P Offline
                  P Offline
                  Paul Conrad
                  wrote on last edited by
                  #54

                  I just stick to whatever I feel like.

                  "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                  1 Reply Last reply
                  0
                  • V Vikram A Punathambekar

                    Chris Maunder wrote:

                    memberId

                    I use ID instead of Id. FxCop bugs the hell out of me on that one.

                    Cheers, Vıkram.


                    After all is said and done, much is said and little is done.

                    L Offline
                    L Offline
                    Luis Alonso Ramos
                    wrote on last edited by
                    #55

                    I used to use ID but because of FxCop, I changed my habit to Id now.

                    Luis Alonso Ramos Intelectix Chihuahua, Mexico

                    My Blog!

                    1 Reply Last reply
                    0
                    • M MidwestLimey

                      yay for camelCase!


                      I'm largely language agnostic


                      After a while they all bug me :doh:


                      M Offline
                      M Offline
                      Miszou
                      wrote on last edited by
                      #56

                      Whereabouts in the Midwest are you, Limey? I've been a Limey in Central California for almost 9 years now...


                      Sunrise Wallpaper Project | The StartPage Randomizer | A Random Web Page

                      M 1 Reply Last reply
                      0
                      • realJSOPR realJSOP

                        I recently posted a C# article and as a C++ programmer is wont to do, I used hungarian notation on all my variables. This has generated a bit of discussion in the comments for the article, and not wanting to be completely close-minded about it, I decided to google it. Here's what I've found so far: 0) It seems that Microsoft thinks we should abandon it in favor of "more natural english-like" variable names. The best response to that statement was this little gem: "If Microsoft said I shouldn't comment my code, it wouldn't stop me from doing that, either." I could not have said it better myself. Maybe this outlook by Microsoft is why Vista is such garbage, or why the ORCAS Beta 2 is so transiently reliable. Just because some self-important evangelist from Microsoft says it doesn't make it gold. Translation - this claim is pretty weak. This is from Microsoft's coding guidelines: Use names that describe a parameter's meaning rather than names that describe a parameter's type. Development tools should provide meaningful information about a parameter's type. Therefore, a parameter's name can be put to better use by describing meaning. Use type-based parameter names sparingly and only where it is appropriate. It looks to me like they're putting the emphasis on reading code squarely on the end user instead of the developer. Hello!? We're programmers, and we can't be bothered by trying to figure out what type a variable is supposed to be. Sure, code should be easy to read, but that trait is introduced with meaningful variable and function names, not by removing ancillary information about the variables being used. 1) If you change the variable's type, it all of a sudden invalidates the name of the variable. Ever heard of Find/replace (with case matching and whole word turned on)? Besides, I can count on one hand how many times I changed the type of a variable in the last 18 years of C++ work. 2) Puts an emphasis on the type instead of the descriptive identifier name—encourages poor variable names. Ummm, how can a single lowercase character move the emphasis from the following variable name to the type itself. Further, hungarian notation in no way promotes the creation of "poor variable names". I can't recall ever hearing a programmer say, "Yep, using hungarian notation so that means I can skimp on the rest of the variable name." There are other equally invalid reasons put forth by all manner of know-it-alls, but I got bored typing this stuff. ------

                        T Offline
                        T Offline
                        ToddHileHoffer
                        wrote on last edited by
                        #57

                        I might be in minority but I don't really care. If you are using VS2005 Hungarian notation adds little value. Just put the cursor over the object and the type is displayed. Honestly I'm not consistent with my naming. I might have a text box name txtBox1, txtName, txt or just "x" (if I'm using it in a loop). Since I do ASP.Net I don't have to many 10,000 line methods because all the code has to run during a postback. I'm the same way with my database fieldnames, I just don't care. You may call it laziness but I think too many programmers an Anal about this stuff. Like I said before, if I want to know what type something is, I just put the cursor on it.

                        I didn't get any requirements for the signature

                        M 1 Reply Last reply
                        0
                        • realJSOPR realJSOP

                          I recently posted a C# article and as a C++ programmer is wont to do, I used hungarian notation on all my variables. This has generated a bit of discussion in the comments for the article, and not wanting to be completely close-minded about it, I decided to google it. Here's what I've found so far: 0) It seems that Microsoft thinks we should abandon it in favor of "more natural english-like" variable names. The best response to that statement was this little gem: "If Microsoft said I shouldn't comment my code, it wouldn't stop me from doing that, either." I could not have said it better myself. Maybe this outlook by Microsoft is why Vista is such garbage, or why the ORCAS Beta 2 is so transiently reliable. Just because some self-important evangelist from Microsoft says it doesn't make it gold. Translation - this claim is pretty weak. This is from Microsoft's coding guidelines: Use names that describe a parameter's meaning rather than names that describe a parameter's type. Development tools should provide meaningful information about a parameter's type. Therefore, a parameter's name can be put to better use by describing meaning. Use type-based parameter names sparingly and only where it is appropriate. It looks to me like they're putting the emphasis on reading code squarely on the end user instead of the developer. Hello!? We're programmers, and we can't be bothered by trying to figure out what type a variable is supposed to be. Sure, code should be easy to read, but that trait is introduced with meaningful variable and function names, not by removing ancillary information about the variables being used. 1) If you change the variable's type, it all of a sudden invalidates the name of the variable. Ever heard of Find/replace (with case matching and whole word turned on)? Besides, I can count on one hand how many times I changed the type of a variable in the last 18 years of C++ work. 2) Puts an emphasis on the type instead of the descriptive identifier name—encourages poor variable names. Ummm, how can a single lowercase character move the emphasis from the following variable name to the type itself. Further, hungarian notation in no way promotes the creation of "poor variable names". I can't recall ever hearing a programmer say, "Yep, using hungarian notation so that means I can skimp on the rest of the variable name." There are other equally invalid reasons put forth by all manner of know-it-alls, but I got bored typing this stuff. ------

                          L Offline
                          L Offline
                          Luis Alonso Ramos
                          wrote on last edited by
                          #58

                          As others have pointed, I try to do as the framework/language does. For C++ (which I rarely do these days), I use hungarian notation. For C# I try to use the .NET notation (to be consistent with the framework). I've got used to it, and it works fine for me. I remember when I started with C#, I used hungarian notation. But it just didn't feel right mixing it with .NET's variable names. I think that's what made me change. And with well-chosen variable names, the type can be deducted from the name. The conclusion here, is do it however you want to do it, but just try to be consistent (worse than any standard is no standard).

                          Luis Alonso Ramos Intelectix Chihuahua, Mexico

                          My Blog!

                          1 Reply Last reply
                          0
                          • V Vikram A Punathambekar

                            Chris Maunder wrote:

                            memberId

                            I use ID instead of Id. FxCop bugs the hell out of me on that one.

                            Cheers, Vıkram.


                            After all is said and done, much is said and little is done.

                            M Offline
                            M Offline
                            Marc Clifton
                            wrote on last edited by
                            #59

                            Vikram A Punathambekar wrote:

                            I use ID instead of Id. FxCop bugs the hell out of me on that one.

                            Really? Because I thought the standard with acronyms and abbreviations was to uppercase for the first letter, lower for the rest. Marc

                            Thyme In The Country
                            Interacx
                            My Blog

                            V G P 3 Replies Last reply
                            0
                            • realJSOPR realJSOP

                              I recently posted a C# article and as a C++ programmer is wont to do, I used hungarian notation on all my variables. This has generated a bit of discussion in the comments for the article, and not wanting to be completely close-minded about it, I decided to google it. Here's what I've found so far: 0) It seems that Microsoft thinks we should abandon it in favor of "more natural english-like" variable names. The best response to that statement was this little gem: "If Microsoft said I shouldn't comment my code, it wouldn't stop me from doing that, either." I could not have said it better myself. Maybe this outlook by Microsoft is why Vista is such garbage, or why the ORCAS Beta 2 is so transiently reliable. Just because some self-important evangelist from Microsoft says it doesn't make it gold. Translation - this claim is pretty weak. This is from Microsoft's coding guidelines: Use names that describe a parameter's meaning rather than names that describe a parameter's type. Development tools should provide meaningful information about a parameter's type. Therefore, a parameter's name can be put to better use by describing meaning. Use type-based parameter names sparingly and only where it is appropriate. It looks to me like they're putting the emphasis on reading code squarely on the end user instead of the developer. Hello!? We're programmers, and we can't be bothered by trying to figure out what type a variable is supposed to be. Sure, code should be easy to read, but that trait is introduced with meaningful variable and function names, not by removing ancillary information about the variables being used. 1) If you change the variable's type, it all of a sudden invalidates the name of the variable. Ever heard of Find/replace (with case matching and whole word turned on)? Besides, I can count on one hand how many times I changed the type of a variable in the last 18 years of C++ work. 2) Puts an emphasis on the type instead of the descriptive identifier name—encourages poor variable names. Ummm, how can a single lowercase character move the emphasis from the following variable name to the type itself. Further, hungarian notation in no way promotes the creation of "poor variable names". I can't recall ever hearing a programmer say, "Yep, using hungarian notation so that means I can skimp on the rest of the variable name." There are other equally invalid reasons put forth by all manner of know-it-alls, but I got bored typing this stuff. ------

                              J Offline
                              J Offline
                              James Brown
                              wrote on last edited by
                              #60

                              I only use hungarian-notation because it's what I'm used to - but I much prefer: variableName as opposed to dwVariableName I think the first is much easier to read. There's already been alot of very good points on how IDE's can help out more these days. If I'm doing Windows C/C++ code then I'll use hungarian, otherwise I'll use camel-case. http://ootips.org/hungarian-notation.html[^] There was an article floating around on the web a while back about how Hungarian-notation as we know it is not very useful. There is another variant (IIRC called 'apps hungarian' which names variables after their usage rather than their base-type. http://blogs.msdn.com/larryosterman/archive/2004/06/22/162629.aspx[^] might be interesting to you..


                              http://www.catch22.net

                              1 Reply Last reply
                              0
                              • V VonHagNDaz

                                I've been at my Job(1st since graduating college), for about a year now, and I dont know what I'd do without the notation. I'm mostly dealing with code that has somewhere along the lines of 10000 line functions. Having to scroll up to check types for variable types only used once would be beyond a pain in the a**. So hurray for Hungarian Notation for saving me precious time and facilitating my laziness to scroll up.

                                [Insert Witty Sig Here]

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

                                VonHagNDaz wrote:

                                I'm mostly dealing with code that has somewhere along the lines of 10000 line functions. Having to scroll up to check types for variable types only used once would be beyond a pain in the a**. So hurray for Hungarian Notation for saving me precious time and facilitating my laziness to scroll up.

                                Wow! Sounds like you should be spending time refactoring the code rather than using Hungarian Notation. Seriously. If a method is over a couple of dozen lines then you should look at refactoring it.


                                Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." My website

                                V C 2 Replies Last reply
                                0
                                • M Marc Clifton

                                  I was never into Hungarian Notation to begin with, but... Look at C# 3.0's "var" keyword. Examples here[^] about 1/2 down. I think the var keyword might be reason to bring back Hungarian Notation, because you have no idea what type the var is unless you look at the initializer. Now, from what I've heard from others, the var keyword is really just a convenience for not typing in the complete type (which I disapprove of), but I suspect there are better uses. Marc

                                  Thyme In The Country
                                  Interacx
                                  My Blog

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

                                  Marc Clifton wrote:

                                  I think the var keyword might be reason to bring back Hungarian Notation, because you have no idea what type the var is unless you look at the initializer.

                                  And if the var is holding an anonymous type? What would you put for the Hungarian Notation. I don't think I would ever use var for known types.


                                  Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." My website

                                  J 1 Reply Last reply
                                  0
                                  • C Colin Angus Mackay

                                    VonHagNDaz wrote:

                                    I'm mostly dealing with code that has somewhere along the lines of 10000 line functions. Having to scroll up to check types for variable types only used once would be beyond a pain in the a**. So hurray for Hungarian Notation for saving me precious time and facilitating my laziness to scroll up.

                                    Wow! Sounds like you should be spending time refactoring the code rather than using Hungarian Notation. Seriously. If a method is over a couple of dozen lines then you should look at refactoring it.


                                    Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." My website

                                    V Offline
                                    V Offline
                                    VonHagNDaz
                                    wrote on last edited by
                                    #63

                                    "Don't change it, the code works. Why would we change existing code if it works? If its already done, we shouldn't have to go back and rework it. It's worked this long, surely there is no need to fix what isnt broke..." - Manager

                                    [Insert Witty Sig Here]

                                    1 Reply Last reply
                                    0
                                    • C Colin Angus Mackay

                                      VonHagNDaz wrote:

                                      I'm mostly dealing with code that has somewhere along the lines of 10000 line functions. Having to scroll up to check types for variable types only used once would be beyond a pain in the a**. So hurray for Hungarian Notation for saving me precious time and facilitating my laziness to scroll up.

                                      Wow! Sounds like you should be spending time refactoring the code rather than using Hungarian Notation. Seriously. If a method is over a couple of dozen lines then you should look at refactoring it.


                                      Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." My website

                                      C Offline
                                      C Offline
                                      Cyrilix
                                      wrote on last edited by
                                      #64

                                      That's 24 lines. Wow. I can imagine your code would be so highly componentized as to have to trace 50 layers down the call stack in order to find out what you're actually doing. I hope you're exaggerating -- to me, anywhere up to 150 lines sounds a bit more realistic.

                                      C 1 Reply Last reply
                                      0
                                      • M Marc Clifton

                                        Vikram A Punathambekar wrote:

                                        I use ID instead of Id. FxCop bugs the hell out of me on that one.

                                        Really? Because I thought the standard with acronyms and abbreviations was to uppercase for the first letter, lower for the rest. Marc

                                        Thyme In The Country
                                        Interacx
                                        My Blog

                                        V Offline
                                        V Offline
                                        Vikram A Punathambekar
                                        wrote on last edited by
                                        #65

                                        Marc Clifton wrote:

                                        I thought the standard with acronyms and abbreviations was to uppercase for the first letter, lower for the rest.

                                        Except when the acronym has only two letters.

                                        System.IO
                                        IPAddress

                                        Cheers, Vıkram.


                                        After all is said and done, much is said and little is done.

                                        1 Reply Last reply
                                        0
                                        • C Colin Angus Mackay

                                          Marc Clifton wrote:

                                          I think the var keyword might be reason to bring back Hungarian Notation, because you have no idea what type the var is unless you look at the initializer.

                                          And if the var is holding an anonymous type? What would you put for the Hungarian Notation. I don't think I would ever use var for known types.


                                          Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." My website

                                          J Offline
                                          J Offline
                                          Judah Gabriel Himango
                                          wrote on last edited by
                                          #66

                                          I agree, although I can see myself using var for long types like Dictionar<EventHandler<SomeArgs>, KeyValuePair<int, string>>. Typing long stuff like that twice in the declaration is superfluous. Sometimes I wish we'd just adopt Ruby or Boo syntax for that stuff. Something like:

                                          Dictionary<...> whatever = new();

                                          Tech, life, family, faith: Give me a visit. I'm currently blogging about: Orthodox Jews are persecuting Messianic Jews in Israel (video) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

                                          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