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. visual C# 2005 exiting

visual C# 2005 exiting

Scheduled Pinned Locked Moved C#
csharphelptutorial
56 Posts 9 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.
  • D Dave Kreskowiak

    It sounds like you need to rethink your logic a bit. The requirements you just spelled out shouldn't require such a complex if statement.

    A guide to posting questions on CodeProject[^]
    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
         2006, 2007

    X Offline
    X Offline
    xxmikexx
    wrote on last edited by
    #42

    o really lol i guess there would be a better way

    1 Reply Last reply
    0
    • N Not Active

      Wow, you found my resume online. I'm impressed and awed by your skills. I see that not only are you an experienced developer, but also a psychologist. So tell me Dr., why do I hate my mother? Speaking of mothers, I think yours is calling. It's past your bedtime anyway, so run along little one.


      only two letters away from being an asset

      X Offline
      X Offline
      xxmikexx
      wrote on last edited by
      #43

      haha for a "big mature adult" which for whatever you seem to think you are, you behave much more imaturely than my little sister, i cant explain y you hate your mother but probably because you are a failure to what you truly want to be have average skills and think that towering over younger people and imposing your measly imaginitive power deep down inside this makes you feel better and people liek you need to grow up and are just dispicable.

      1 Reply Last reply
      0
      • N Not Active

        Wow, you found my resume online. I'm impressed and awed by your skills. I see that not only are you an experienced developer, but also a psychologist. So tell me Dr., why do I hate my mother? Speaking of mothers, I think yours is calling. It's past your bedtime anyway, so run along little one.


        only two letters away from being an asset

        R Offline
        R Offline
        rockNroll
        wrote on last edited by
        #44

        Looking at your experience, i am sure you are definitely over 30 yrs of age. And mike is a kid in front of you...Common man..chill out now. It's not making you any better. Be nice with others and they ll be nice with you. ***Simple golden rule*** :)

        X N M 3 Replies Last reply
        0
        • R rockNroll

          Looking at your experience, i am sure you are definitely over 30 yrs of age. And mike is a kid in front of you...Common man..chill out now. It's not making you any better. Be nice with others and they ll be nice with you. ***Simple golden rule*** :)

          X Offline
          X Offline
          xxmikexx
          wrote on last edited by
          #45

          haha ya i agree i probably should of just ignored everthing he said but it is funny since he is getting mad over nothing i dont care lol

          1 Reply Last reply
          0
          • R rockNroll

            Looking at your experience, i am sure you are definitely over 30 yrs of age. And mike is a kid in front of you...Common man..chill out now. It's not making you any better. Be nice with others and they ll be nice with you. ***Simple golden rule*** :)

            N Offline
            N Offline
            Not Active
            wrote on last edited by
            #46

            Oh come on, it sure is fun and certainly made the day go by :laugh:


            only two letters away from being an asset

            X 1 Reply Last reply
            0
            • N Not Active

              Oh come on, it sure is fun and certainly made the day go by :laugh:


              only two letters away from being an asset

              X Offline
              X Offline
              xxmikexx
              wrote on last edited by
              #47

              haha he is trying to act like he doesnt care well he is probably about ready to run home to mommy to lick his wounds

              R 1 Reply Last reply
              0
              • X xxmikexx

                haha he is trying to act like he doesnt care well he is probably about ready to run home to mommy to lick his wounds

                R Offline
                R Offline
                rockNroll
                wrote on last edited by
                #48

                Anyway mike you need to stop replying back now. Finish it now. He is quite elder to you..so you can take a initiative to be good with him by not stretching this more... All the best.

                X 1 Reply Last reply
                0
                • R rockNroll

                  Anyway mike you need to stop replying back now. Finish it now. He is quite elder to you..so you can take a initiative to be good with him by not stretching this more... All the best.

                  X Offline
                  X Offline
                  xxmikexx
                  wrote on last edited by
                  #49

                  ya you are right thank you all for helping me with my problem

                  1 Reply Last reply
                  0
                  • R rockNroll

                    Looking at your experience, i am sure you are definitely over 30 yrs of age. And mike is a kid in front of you...Common man..chill out now. It's not making you any better. Be nice with others and they ll be nice with you. ***Simple golden rule*** :)

                    M Offline
                    M Offline
                    MarkB777
                    wrote on last edited by
                    #50

                    I think its funny :)

                    1 Reply Last reply
                    0
                    • E Ennis Ray Lynch Jr

                      Unfortunately, the nature of business software development causes me to recommend against this. Using structured exists simplifies debugging and serves as a preventative measure from a junior programmer going haywire with a 10 page method. While I can say a deeply nested conditional does breed defects the case is made to follow Fowler on this one and refactor into more simpler methods.

                      Need a C# Consultant? I'm available.
                      Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                      L Offline
                      L Offline
                      led mike
                      wrote on last edited by
                      #51

                      Ennis Ray Lynch, Jr. wrote:

                      Unfortunately, the nature of business software development

                      That book is specifically directed at business software. Again, I highly recommend it. There is no way I am going believe my perspective is more reliable than someone like Kent Beck. Following the advice of experts in the industry like Beck is what I have always done, I am not about to change that now.

                      Ennis Ray Lynch, Jr. wrote:

                      the case is made to follow Fowler on this one

                      This is from the first page of the book: "Many people don't realize how readable code can be and how valuable that readability is. Kent has taught me so much, I'm glad this book gives everyone the chance to learn from him." - Martin Fowler, chief scientist, ThoughtWorks There are six people endorsing the book on that first page, one of them besides Fowler is Erich Gamma.

                      Ennis Ray Lynch, Jr. wrote:

                      and refactor into more simpler methods.

                      The small excerpt I posted does not provide his entire discussion on the subject of Guard Clauses nor the context for the entire book nor the books discussion of refactoring into smaller methods. Perhaps before concluding his reasoning is wrong, you might want to read the book so you can know what his reasoning is before you decide to dismiss it.

                      led mike

                      E 1 Reply Last reply
                      0
                      • L led mike

                        Ennis Ray Lynch, Jr. wrote:

                        Unfortunately, the nature of business software development

                        That book is specifically directed at business software. Again, I highly recommend it. There is no way I am going believe my perspective is more reliable than someone like Kent Beck. Following the advice of experts in the industry like Beck is what I have always done, I am not about to change that now.

                        Ennis Ray Lynch, Jr. wrote:

                        the case is made to follow Fowler on this one

                        This is from the first page of the book: "Many people don't realize how readable code can be and how valuable that readability is. Kent has taught me so much, I'm glad this book gives everyone the chance to learn from him." - Martin Fowler, chief scientist, ThoughtWorks There are six people endorsing the book on that first page, one of them besides Fowler is Erich Gamma.

                        Ennis Ray Lynch, Jr. wrote:

                        and refactor into more simpler methods.

                        The small excerpt I posted does not provide his entire discussion on the subject of Guard Clauses nor the context for the entire book nor the books discussion of refactoring into smaller methods. Perhaps before concluding his reasoning is wrong, you might want to read the book so you can know what his reasoning is before you decide to dismiss it.

                        led mike

                        E Offline
                        E Offline
                        Ennis Ray Lynch Jr
                        wrote on last edited by
                        #52

                        I have read both books and I agree with the authors on many precepts, however, the books suffer from the fundamental flaw of assuming expert level developers or developers with motivation to develop good code. Most business environments I go to love to say, "We don't have blame here" or "No one owns the code". Those two premises invalidate both books as they lead to engineering disasters. My advice is not necessarily aimed at the ideal art of development because the ideal environment is usually corrupted. With respect to guard classes there is another refactor that suggests it would be more appropriate to use inheritance to make a decision like this. Furthermore, in a guard class is is presumed that the early returns have a very low weighted value and are exceptional and not normal flow actions. The very reason for the guard clause is to illustrate the importance. Unfortunately, what I usually end up correcting is massive series of if-then-else statements spanning many pages littered with returns. I guess to put my opinion in context: if I came across a method with a well thought out series of guard clauses I would leave it alone. Unfortunately, I have seen virtually no methods that fall into the narrow scope of guard clauses and I have been around the block a few times.

                        Need a C# Consultant? I'm available.
                        Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                        L 1 Reply Last reply
                        0
                        • E Ennis Ray Lynch Jr

                          I have read both books and I agree with the authors on many precepts, however, the books suffer from the fundamental flaw of assuming expert level developers or developers with motivation to develop good code. Most business environments I go to love to say, "We don't have blame here" or "No one owns the code". Those two premises invalidate both books as they lead to engineering disasters. My advice is not necessarily aimed at the ideal art of development because the ideal environment is usually corrupted. With respect to guard classes there is another refactor that suggests it would be more appropriate to use inheritance to make a decision like this. Furthermore, in a guard class is is presumed that the early returns have a very low weighted value and are exceptional and not normal flow actions. The very reason for the guard clause is to illustrate the importance. Unfortunately, what I usually end up correcting is massive series of if-then-else statements spanning many pages littered with returns. I guess to put my opinion in context: if I came across a method with a well thought out series of guard clauses I would leave it alone. Unfortunately, I have seen virtually no methods that fall into the narrow scope of guard clauses and I have been around the block a few times.

                          Need a C# Consultant? I'm available.
                          Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                          L Offline
                          L Offline
                          led mike
                          wrote on last edited by
                          #53

                          Ennis Ray Lynch, Jr. wrote:

                          Most business environments I go to love to say, "We don't have blame here" or "No one owns the code".

                          Ok, I understand you believe there are special circumstances ( though widely implemented) that make you believe it might not be practical, but that's not what you said:

                          Ennis Ray Lynch, Jr. wrote:

                          Return is not allowed inside of methods more than once and should not be used by any method that does not have a functional result. Doing so is a poor programming practice that violates the one-in, one-out principle.

                          It's not poor programming practice. What you described is actually poor programming practice, you just think it's more practical given your stated circumstances. Or have I misunderstood your point?

                          led mike

                          E 1 Reply Last reply
                          0
                          • L led mike

                            Ennis Ray Lynch, Jr. wrote:

                            Most business environments I go to love to say, "We don't have blame here" or "No one owns the code".

                            Ok, I understand you believe there are special circumstances ( though widely implemented) that make you believe it might not be practical, but that's not what you said:

                            Ennis Ray Lynch, Jr. wrote:

                            Return is not allowed inside of methods more than once and should not be used by any method that does not have a functional result. Doing so is a poor programming practice that violates the one-in, one-out principle.

                            It's not poor programming practice. What you described is actually poor programming practice, you just think it's more practical given your stated circumstances. Or have I misunderstood your point?

                            led mike

                            E Offline
                            E Offline
                            Ennis Ray Lynch Jr
                            wrote on last edited by
                            #54

                            I think we are beginning to understand. However, the point of my blanket statement is the fact that when introducing novice, inexperienced, or lazy programmers to the concept you cannot provide options. The allowance for violating the rule, is in my opinion, an advanced concept that a developer will naturally get on their own. My blanket statement will be ignored by anyone with the experience to do so and should be headed by anyone without the experience. Maybe my error was in the presentation by saying not to listen to anyone else. However, experienced developers encouraging an inexperienced developer down the wrong path risks much. Sometimes I am a condescending A**, so you must forgive me :p

                            Need a C# Consultant? I'm available.
                            Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                            L 1 Reply Last reply
                            0
                            • E Ennis Ray Lynch Jr

                              I think we are beginning to understand. However, the point of my blanket statement is the fact that when introducing novice, inexperienced, or lazy programmers to the concept you cannot provide options. The allowance for violating the rule, is in my opinion, an advanced concept that a developer will naturally get on their own. My blanket statement will be ignored by anyone with the experience to do so and should be headed by anyone without the experience. Maybe my error was in the presentation by saying not to listen to anyone else. However, experienced developers encouraging an inexperienced developer down the wrong path risks much. Sometimes I am a condescending A**, so you must forgive me :p

                              Need a C# Consultant? I'm available.
                              Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                              L Offline
                              L Offline
                              led mike
                              wrote on last edited by
                              #55

                              Ennis Ray Lynch, Jr. wrote:

                              Sometimes I am a condescending A**, so you must forgive me

                              And I'm not :laugh: Yeah I wasn't concerned with that, just the statement of it being bad practice is all. No doubt the way the original poster was about to use it actually would  be bad practice. :-D

                              led mike

                              X 1 Reply Last reply
                              0
                              • L led mike

                                Ennis Ray Lynch, Jr. wrote:

                                Sometimes I am a condescending A**, so you must forgive me

                                And I'm not :laugh: Yeah I wasn't concerned with that, just the statement of it being bad practice is all. No doubt the way the original poster was about to use it actually would  be bad practice. :-D

                                led mike

                                X Offline
                                X Offline
                                xxmikexx
                                wrote on last edited by
                                #56

                                haha ya i just needed it to check input and if it was not correct exit and it worked thank you all

                                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