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. Programming isn't hard...

Programming isn't hard...

Scheduled Pinned Locked Moved The Lounge
66 Posts 31 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.
  • Sander RosselS Sander Rossel

    Thinking of names for your classes and variables, THAT's hard... :doh: Frustration #1 of the evening... :sigh:

    It's an OO world.

    public class Naerling : Lazy<Person>{}

    OriginalGriffO Offline
    OriginalGriffO Offline
    OriginalGriff
    wrote on last edited by
    #3

    Not really - just use names that say what they are. If you are trying to think up polite ways to call them after your ex-girlfriends, then yes, I can see where you might have difficulty. But if a class is meant to handle user information, then I would probably call it "UserInfo" rather than "RurikoPityHerVisaRanOutAndSheHadToGoBackToJapan" or "MarionWentAllWierdAndBecameBornAgain". Similarly with open file dialog references - I generally call them "ofd" for the short time they are in existance. :laugh:

    Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

    I Sander RosselS 2 Replies Last reply
    0
    • Sander RosselS Sander Rossel

      Thinking of names for your classes and variables, THAT's hard... :doh: Frustration #1 of the evening... :sigh:

      It's an OO world.

      public class Naerling : Lazy<Person>{}

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #4

      Naerling wrote:

      Thinking of names for your classes and variables, THAT's hard... :doh:
      Frustration #1 of the evening... :sigh:

      I solve this by using a single Object variable called theKey across my entire project. I assign all local references to this variable and cast to the required derived type before calling a method or property. On occasions I may need two or even three such variables (I suffix 1,2,3 to get theKey1 and so on). Problem solved. :-\

      Regards, Nish


      My technology blog: voidnish.wordpress.com

      OriginalGriffO Sander RosselS A G L 5 Replies Last reply
      0
      • _ _beauw_

        You might get something out of this classic[^].

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #5

        I'd forgotten just how impenetrably Dijkstra wrote: I needed a good long run up to read him when I was a student. And several large drinks afterwards. Mind you, at least he didn't make you fall asleep like Knuth did... But that could have been the large drinks!

        Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        _ 1 Reply Last reply
        0
        • N Nish Nishant

          Naerling wrote:

          Thinking of names for your classes and variables, THAT's hard... :doh:
          Frustration #1 of the evening... :sigh:

          I solve this by using a single Object variable called theKey across my entire project. I assign all local references to this variable and cast to the required derived type before calling a method or property. On occasions I may need two or even three such variables (I suffix 1,2,3 to get theKey1 and so on). Problem solved. :-\

          Regards, Nish


          My technology blog: voidnish.wordpress.com

          Sander RosselS Offline
          Sander RosselS Offline
          Sander Rossel
          wrote on last edited by
          #6

          Wow, you should post that as a tip/trick or even write an article about that! That just solved all my problems (and created them for future readers of my code)! ;p

          It's an OO world.

          public class Naerling : Lazy<Person>{}

          1 Reply Last reply
          0
          • N Nish Nishant

            Naerling wrote:

            Thinking of names for your classes and variables, THAT's hard... :doh:
            Frustration #1 of the evening... :sigh:

            I solve this by using a single Object variable called theKey across my entire project. I assign all local references to this variable and cast to the required derived type before calling a method or property. On occasions I may need two or even three such variables (I suffix 1,2,3 to get theKey1 and so on). Problem solved. :-\

            Regards, Nish


            My technology blog: voidnish.wordpress.com

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #7

            I assume that in accordance with good OOP / C# programming practice it is both static and in a Singleton Pattern?

            Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            N 1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              Not really - just use names that say what they are. If you are trying to think up polite ways to call them after your ex-girlfriends, then yes, I can see where you might have difficulty. But if a class is meant to handle user information, then I would probably call it "UserInfo" rather than "RurikoPityHerVisaRanOutAndSheHadToGoBackToJapan" or "MarionWentAllWierdAndBecameBornAgain". Similarly with open file dialog references - I generally call them "ofd" for the short time they are in existance. :laugh:

              Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

              I Offline
              I Offline
              Ian Shlasko
              wrote on last edited by
              #8

              Tenagra t = new Tenagra();
              t.Add(new Darmok());
              t.Add(new Jilad());
              t.Add(new TheBeast());
              t.EpicBattle();
              t.MoveItemsTo(new Ocean());

              Proud to have finally moved to the A-Ark. Which one are you in?
              Author of the Guardians Saga (Sci-Fi/Fantasy novels)

              OriginalGriffO Q 2 Replies Last reply
              0
              • _ _beauw_

                You might get something out of this classic[^].

                Sander RosselS Offline
                Sander RosselS Offline
                Sander Rossel
                wrote on last edited by
                #9

                You mean my code should be gibberish and no one should ever be able to read past the first line? X|

                It's an OO world.

                public class Naerling : Lazy<Person>{}

                I _ 2 Replies Last reply
                0
                • Sander RosselS Sander Rossel

                  You mean my code should be gibberish and no one should ever be able to read past the first line? X|

                  It's an OO world.

                  public class Naerling : Lazy<Person>{}

                  I Offline
                  I Offline
                  Ian Shlasko
                  wrote on last edited by
                  #10

                  Hey, be nice... Some of us made it to the second line :-D

                  Proud to have finally moved to the A-Ark. Which one are you in?
                  Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                  Sander RosselS 1 Reply Last reply
                  0
                  • I Ian Shlasko

                    Tenagra t = new Tenagra();
                    t.Add(new Darmok());
                    t.Add(new Jilad());
                    t.Add(new TheBeast());
                    t.EpicBattle();
                    t.MoveItemsTo(new Ocean());

                    Proud to have finally moved to the A-Ark. Which one are you in?
                    Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                    OriginalGriffO Offline
                    OriginalGriffO Offline
                    OriginalGriff
                    wrote on last edited by
                    #11

                    Is that a quote from the Guardians Saga? I do note however, that when you have moved all these items into the new ocean, you then discard the reference and effectively leave them adrift waiting for the Dark Lord G'Bge Cll'ctr to come and find them...

                    Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                    I M 2 Replies Last reply
                    0
                    • OriginalGriffO OriginalGriff

                      I assume that in accordance with good OOP / C# programming practice it is both static and in a Singleton Pattern?

                      Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

                      N Offline
                      N Offline
                      Nish Nishant
                      wrote on last edited by
                      #12

                      OriginalGriff wrote:

                      I assume that in accordance with good OOP / C# programming practice it is both static and in a Singleton Pattern?

                      Yes, that goes without saying. Always follow good practices I guess :-D

                      Regards, Nish


                      My technology blog: voidnish.wordpress.com

                      1 Reply Last reply
                      0
                      • N Nish Nishant

                        Naerling wrote:

                        Thinking of names for your classes and variables, THAT's hard... :doh:
                        Frustration #1 of the evening... :sigh:

                        I solve this by using a single Object variable called theKey across my entire project. I assign all local references to this variable and cast to the required derived type before calling a method or property. On occasions I may need two or even three such variables (I suffix 1,2,3 to get theKey1 and so on). Problem solved. :-\

                        Regards, Nish


                        My technology blog: voidnish.wordpress.com

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

                        I prefer to call all my variables a1, a2, a3, a4, and so on. Also, once I get to a6, I use another letter (say, b1)... that way, I only ever have to use my left hand and can keep my right hand on the mouse. It's a very efficient technique I wish everybody else would adopt. Until then, I just refactor all the code I see with overly long variable names like "count" (that's a particularly bad name because some of the characters require the right hand to type). I sleep easily at night, comfortable in the knowledge that all my refactoring has made the world a better place. :-\

                        Somebody in an online forum wrote:

                        INTJs never really joke. They make a point. The joke is just a gift wrapper.

                        H R 2 Replies Last reply
                        0
                        • Sander RosselS Sander Rossel

                          Thinking of names for your classes and variables, THAT's hard... :doh: Frustration #1 of the evening... :sigh:

                          It's an OO world.

                          public class Naerling : Lazy<Person>{}

                          C Offline
                          C Offline
                          Chris Losinger
                          wrote on last edited by
                          #14

                          i name every CWaitCursor i create the same thing: bob. true story.

                          image processing toolkits | batch image processing

                          Sander RosselS 1 Reply Last reply
                          0
                          • OriginalGriffO OriginalGriff

                            Not really - just use names that say what they are. If you are trying to think up polite ways to call them after your ex-girlfriends, then yes, I can see where you might have difficulty. But if a class is meant to handle user information, then I would probably call it "UserInfo" rather than "RurikoPityHerVisaRanOutAndSheHadToGoBackToJapan" or "MarionWentAllWierdAndBecameBornAgain". Similarly with open file dialog references - I generally call them "ofd" for the short time they are in existance. :laugh:

                            Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

                            Sander RosselS Offline
                            Sander RosselS Offline
                            Sander Rossel
                            wrote on last edited by
                            #15

                            Allright, here it goes. I have an Object of any type that needs to have something done with/upon it. What is this Object called? Simply obj seems to easy. objToDoSomethingWith is to long. handledObj sounds as if something has already been done with it. handlingObj is just weird. objToHandle, well that might cause confusion. I could replace obj with item, but that does not solve anything. Perhaps I should not be thinking about this at the end of the day. Or perhaps I should just go with obj... Or item. Choices, choices... :sigh:

                            It's an OO world.

                            public class Naerling : Lazy<Person>{}

                            A 1 Reply Last reply
                            0
                            • OriginalGriffO OriginalGriff

                              Is that a quote from the Guardians Saga? I do note however, that when you have moved all these items into the new ocean, you then discard the reference and effectively leave them adrift waiting for the Dark Lord G'Bge Cll'ctr to come and find them...

                              Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

                              I Offline
                              I Offline
                              Ian Shlasko
                              wrote on last edited by
                              #16

                              Uh, no.... Not a Trekkie[^], are you?

                              Proud to have finally moved to the A-Ark. Which one are you in?
                              Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                              OriginalGriffO 1 Reply Last reply
                              0
                              • Sander RosselS Sander Rossel

                                Thinking of names for your classes and variables, THAT's hard... :doh: Frustration #1 of the evening... :sigh:

                                It's an OO world.

                                public class Naerling : Lazy<Person>{}

                                C Offline
                                C Offline
                                CalvinHobbies
                                wrote on last edited by
                                #17

                                (Hands you 100 001 baby names book) this should help. :) Append] this kinda goes along with the C# numeration and collections example where by the authur used "MyCult" as an example (great idea by the way).

                                ///////////////// -Negative, I am a meat popsicle.

                                1 Reply Last reply
                                0
                                • OriginalGriffO OriginalGriff

                                  Is that a quote from the Guardians Saga? I do note however, that when you have moved all these items into the new ocean, you then discard the reference and effectively leave them adrift waiting for the Dark Lord G'Bge Cll'ctr to come and find them...

                                  Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

                                  M Offline
                                  M Offline
                                  Marc A Brown
                                  wrote on last edited by
                                  #18

                                  OriginalGriff wrote:

                                  Is that a quote from the Guardians Saga?

                                  Nope. Star Trek: The Next Generation [^] reference.

                                  1 Reply Last reply
                                  0
                                  • I Ian Shlasko

                                    Uh, no.... Not a Trekkie[^], are you?

                                    Proud to have finally moved to the A-Ark. Which one are you in?
                                    Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                                    OriginalGriffO Offline
                                    OriginalGriffO Offline
                                    OriginalGriff
                                    wrote on last edited by
                                    #19

                                    Sometimes - but Wesley Crusher scarred me so badly I couldn't watch TNG so the references didn't mean anything.

                                    Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

                                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                                    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                                    I 1 Reply Last reply
                                    0
                                    • I Ian Shlasko

                                      Hey, be nice... Some of us made it to the second line :-D

                                      Proud to have finally moved to the A-Ark. Which one are you in?
                                      Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                                      Sander RosselS Offline
                                      Sander RosselS Offline
                                      Sander Rossel
                                      wrote on last edited by
                                      #20

                                      Yes, but how long did it take? And this is not even code. If reading this in code would take you as long as reading this in plain text the code would not even compile anymore on the computers that, by that time, have become modern ;p

                                      It's an OO world.

                                      public class Naerling : Lazy<Person>{}

                                      I 1 Reply Last reply
                                      0
                                      • C Chris Losinger

                                        i name every CWaitCursor i create the same thing: bob. true story.

                                        image processing toolkits | batch image processing

                                        Sander RosselS Offline
                                        Sander RosselS Offline
                                        Sander Rossel
                                        wrote on last edited by
                                        #21

                                        bobj? :)

                                        It's an OO world.

                                        public class Naerling : Lazy<Person>{}

                                        1 Reply Last reply
                                        0
                                        • OriginalGriffO OriginalGriff

                                          Sometimes - but Wesley Crusher scarred me so badly I couldn't watch TNG so the references didn't mean anything.

                                          Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

                                          I Offline
                                          I Offline
                                          Ian Shlasko
                                          wrote on last edited by
                                          #22

                                          Oh, come on... The character may have been a bit silly, but Wil Wheaton is cool... Gotta respect any Hollywood actor who's an active member of Slashdot.

                                          Proud to have finally moved to the A-Ark. Which one are you in?
                                          Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                                          OriginalGriffO 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