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. Try....Catch

Try....Catch

Scheduled Pinned Locked Moved The Lounge
csharp
42 Posts 21 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

    You're being a bit harsh, at least he was trying :laugh:

    It's an OO world.

    public class SanderRossel : Lazy<Person>
    {
    public void DoWork()
    {
    throw new NotSupportedException();
    }
    }

    My blog[^]

    C Offline
    C Offline
    codejet
    wrote on last edited by
    #5

    Well he tried, I caught him. Boss :Try , Coder : Catch

    H 1 Reply Last reply
    0
    • P PIEBALDconsult

      "Well, you can try this code, but the catch is that it swallows Exceptions."

      G Offline
      G Offline
      glennPattonWork3
      wrote on last edited by
      #6

      I have had to do that on a project where the test rig was dodgy. Try { blah, blah, balh!} catch { Messagebox.Show(" Error State") ugly ugly code that gave a reasonable result! the Try Catch everything is a way to get yourself out the firing line and some body else into it! so been there, done that, got the T-Shirt! :-D

      1 Reply Last reply
      0
      • P PIEBALDconsult

        "Well, you can try this code, but the catch is that it swallows Exceptions."

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #7

        finally a good answer. :-D /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        C 1 Reply Last reply
        0
        • R Ravi Bhavnani

          finally a good answer. :-D /ravi

          My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

          C Offline
          C Offline
          codejet
          wrote on last edited by
          #8

          Programmer humour. Precious !! Nothing like it.

          1 Reply Last reply
          0
          • C codejet

            Working for a small IT firm I was not making much progress on a project using VB.NET so my boss who was once a programmer (VB6) decided to do some pair programming with me. We googled some code that had a try..catch block, the dude had no idea that the "Try" part was part of the code. He thought the author was saying i should try the code below. I stopped straight away and told him to go back to his office. Guess I should have asked what he thought the catch part was for. My advice to all owners of all small software development firms ; have some idea of what technologies and programming languages your employees are using to make all those products that bring in all that money for you.Dont emabarass yourself!

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #9

            The first rule of VB6 programmer is to start every function from ON ERROR RESUME NEXT. Program is always working, no bugs! Explain to your boss that try...catch does the same in VB .NET.

            C 1 Reply Last reply
            0
            • C codejet

              Working for a small IT firm I was not making much progress on a project using VB.NET so my boss who was once a programmer (VB6) decided to do some pair programming with me. We googled some code that had a try..catch block, the dude had no idea that the "Try" part was part of the code. He thought the author was saying i should try the code below. I stopped straight away and told him to go back to his office. Guess I should have asked what he thought the catch part was for. My advice to all owners of all small software development firms ; have some idea of what technologies and programming languages your employees are using to make all those products that bring in all that money for you.Dont emabarass yourself!

              P Offline
              P Offline
              PhilLenoir
              wrote on last edited by
              #10

              Maybe he was trying to learn (from you). It's easy to poke fun when people don't know something that is everyday to us, but it pays to remember that they may know things you have no clue about. We tend to read sequentially and the first term he didn't understand was "Try". It's even possible that he might have understood "Catch", especially since it has an exception object declared, but didn't realize it had a block scope and thought that the scope was for the whole routine. A little light hearted fun is OK, but if he feels humiliated he will probably not try again and will almost certainly resent you. This wouldn't do either of you any good!

              Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

              J C 2 Replies Last reply
              0
              • C codejet

                Working for a small IT firm I was not making much progress on a project using VB.NET so my boss who was once a programmer (VB6) decided to do some pair programming with me. We googled some code that had a try..catch block, the dude had no idea that the "Try" part was part of the code. He thought the author was saying i should try the code below. I stopped straight away and told him to go back to his office. Guess I should have asked what he thought the catch part was for. My advice to all owners of all small software development firms ; have some idea of what technologies and programming languages your employees are using to make all those products that bring in all that money for you.Dont emabarass yourself!

                S Offline
                S Offline
                Slacker007
                wrote on last edited by
                #11

                What is a benefit in our line of work is that as long as someone is paying attention it is impossible to for someone to fake the funk. You either are the surgeon, or the patient, but not both.

                P 1 Reply Last reply
                0
                • S Slacker007

                  What is a benefit in our line of work is that as long as someone is paying attention it is impossible to for someone to fake the funk. You either are the surgeon, or the patient, but not both.

                  P Offline
                  P Offline
                  PIEBALDconsult
                  wrote on last edited by
                  #12

                  Slacker007 wrote:

                  surgeon, or the patient

                  I thought it was dog or fire hydrant.

                  S P _ 3 Replies Last reply
                  0
                  • P PIEBALDconsult

                    Slacker007 wrote:

                    surgeon, or the patient

                    I thought it was dog or fire hydrant.

                    S Offline
                    S Offline
                    Slacker007
                    wrote on last edited by
                    #13

                    PIEBALDconsult wrote:

                    I thought it was dog or fire hydrant.

                    You are most likely correct. I was trying to be clever and witty but that is clearly not on the docket for today. :)

                    1 Reply Last reply
                    0
                    • P PhilLenoir

                      Maybe he was trying to learn (from you). It's easy to poke fun when people don't know something that is everyday to us, but it pays to remember that they may know things you have no clue about. We tend to read sequentially and the first term he didn't understand was "Try". It's even possible that he might have understood "Catch", especially since it has an exception object declared, but didn't realize it had a block scope and thought that the scope was for the whole routine. A little light hearted fun is OK, but if he feels humiliated he will probably not try again and will almost certainly resent you. This wouldn't do either of you any good!

                      Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                      J Offline
                      J Offline
                      Jeremy Falcon
                      wrote on last edited by
                      #14

                      PhilLenoir wrote:

                      Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                      Nice.

                      Jeremy Falcon

                      P 1 Reply Last reply
                      0
                      • P PIEBALDconsult

                        Slacker007 wrote:

                        surgeon, or the patient

                        I thought it was dog or fire hydrant.

                        P Offline
                        P Offline
                        PhilLenoir
                        wrote on last edited by
                        #15

                        I'm the fire hydrant, but I've been electrified.

                        Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                        P 1 Reply Last reply
                        0
                        • P PhilLenoir

                          I'm the fire hydrant, but I've been electrified.

                          Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                          P Offline
                          P Offline
                          PIEBALDconsult
                          wrote on last edited by
                          #16

                          Then it's good thing I can't produce a laminar flow.

                          P K 2 Replies Last reply
                          0
                          • J Jeremy Falcon

                            PhilLenoir wrote:

                            Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                            Nice.

                            Jeremy Falcon

                            P Offline
                            P Offline
                            PhilLenoir
                            wrote on last edited by
                            #17

                            ta muchly :)

                            Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                            1 Reply Last reply
                            0
                            • P PIEBALDconsult

                              Then it's good thing I can't produce a laminar flow.

                              P Offline
                              P Offline
                              PhilLenoir
                              wrote on last edited by
                              #18

                              You old dog, you!

                              Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                              1 Reply Last reply
                              0
                              • L Lost User

                                The first rule of VB6 programmer is to start every function from ON ERROR RESUME NEXT. Program is always working, no bugs! Explain to your boss that try...catch does the same in VB .NET.

                                C Offline
                                C Offline
                                codejet
                                wrote on last edited by
                                #19

                                The guy is self taught VB 6.0 programmer. Says he was using C++ at varsity, is he not supposed to understand Try...Catch

                                A 1 Reply Last reply
                                0
                                • P PhilLenoir

                                  Maybe he was trying to learn (from you). It's easy to poke fun when people don't know something that is everyday to us, but it pays to remember that they may know things you have no clue about. We tend to read sequentially and the first term he didn't understand was "Try". It's even possible that he might have understood "Catch", especially since it has an exception object declared, but didn't realize it had a block scope and thought that the scope was for the whole routine. A little light hearted fun is OK, but if he feels humiliated he will probably not try again and will almost certainly resent you. This wouldn't do either of you any good!

                                  Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                                  C Offline
                                  C Offline
                                  codejet
                                  wrote on last edited by
                                  #20

                                  I did not humilate him. By the way are you a boss? Don't be offended.

                                  P 1 Reply Last reply
                                  0
                                  • C codejet

                                    I did not humilate him. By the way are you a boss? Don't be offended.

                                    P Offline
                                    P Offline
                                    PhilLenoir
                                    wrote on last edited by
                                    #21

                                    Not offended, nor a boss. Just another minion making an observation on life! :)

                                    Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                                    C 1 Reply Last reply
                                    0
                                    • P PhilLenoir

                                      Not offended, nor a boss. Just another minion making an observation on life! :)

                                      Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                                      C Offline
                                      C Offline
                                      codejet
                                      wrote on last edited by
                                      #22

                                      You have a way with words. You will be a boss in the near future. You are like a puppy that has swallowed a dictionary. Thats not my line got it from Dilbert, I am not sure its his line either.

                                      P K 2 Replies Last reply
                                      0
                                      • C codejet

                                        You have a way with words. You will be a boss in the near future. You are like a puppy that has swallowed a dictionary. Thats not my line got it from Dilbert, I am not sure its his line either.

                                        P Offline
                                        P Offline
                                        PhilLenoir
                                        wrote on last edited by
                                        #23

                                        I've been a boss, but it's unlikely I will be again. I retire in under 5 months! ... and I've never been a PHB. I'm not sure if the swallowed a dictionary should be taken as an insult or compliment, but I've always been blessed (cursed) with a large vocabulary. Just another victim of the English school system! I like puppies!

                                        Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                                        C 1 Reply Last reply
                                        0
                                        • C codejet

                                          The guy is self taught VB 6.0 programmer. Says he was using C++ at varsity, is he not supposed to understand Try...Catch

                                          A Offline
                                          A Offline
                                          Amarnath S
                                          wrote on last edited by
                                          #24

                                          Per this[^], exceptions came to C++ sometime around the early nineties. However, C++ was in existence at least ten years before that. Your boss may have worked on the early versions of C++, which did not have exceptions.

                                          P 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