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. am I doing it right??

am I doing it right??

Scheduled Pinned Locked Moved The Lounge
helpquestion
16 Posts 13 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.
  • J Jason Stern
    class Government
    {
        static void Main()
        {
            try
            {
                Application.Run(new Economy());
                Application.Run(new ForeignAffairs());
            }
            catch (Exception)
            {
                throw new MoneyAtIt();
            }
        }
    }
    

    I know I shouldn't use generic exceptions since they may hide the real problem...

    R Offline
    R Offline
    Rick York
    wrote on last edited by
    #6

    This reminds of an old favorite : If con is the opposite of pro then what is the opposite of progress ?

    S 1 Reply Last reply
    0
    • J Jason Stern
      class Government
      {
          static void Main()
          {
              try
              {
                  Application.Run(new Economy());
                  Application.Run(new ForeignAffairs());
              }
              catch (Exception)
              {
                  throw new MoneyAtIt();
              }
          }
      }
      

      I know I shouldn't use generic exceptions since they may hide the real problem...

      M Offline
      M Offline
      Mladen Jankovic
      wrote on last edited by
      #7

      And what if OutOfMemoryMoney exception occurs? How can you throw more money when don't have any? Oh, wait you can that's why we're discussing it now :)

      [Genetic Algorithm Library]

      D R 2 Replies Last reply
      0
      • M Mladen Jankovic

        And what if OutOfMemoryMoney exception occurs? How can you throw more money when don't have any? Oh, wait you can that's why we're discussing it now :)

        [Genetic Algorithm Library]

        D Offline
        D Offline
        Douglas Troy
        wrote on last edited by
        #8

        Mladen Jankovic wrote:

        And what if OutOfMemoryMoney exception occurs?

        Try
        {
        FederalReserve.PrintMoreMoney();
        }
        Catch(MoneyException ex)
        {
        China.Borrow(Amount.Billions);
        Germany.Borrow(Amount.Billions);
        Japan.Borrow(Amount.Billions);
        SaudiArabia.Borrow(Amount.Billions);
        }
        Finally
        {
        Military.Run(Action.Invade, Country.Random(AxisOfEvil));
        }


        :..::. Douglas H. Troy ::..
        Bad Astronomy |VCF|wxWidgets|WTL

        1 Reply Last reply
        0
        • J Jason Stern
          class Government
          {
              static void Main()
              {
                  try
                  {
                      Application.Run(new Economy());
                      Application.Run(new ForeignAffairs());
                  }
                  catch (Exception)
                  {
                      throw new MoneyAtIt();
                  }
              }
          }
          

          I know I shouldn't use generic exceptions since they may hide the real problem...

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

          ...you're probably not :)

          C 1 Reply Last reply
          0
          • L Lost User

            ...you're probably not :)

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #10

            I've always wondered if any guy in real life says 'was it good for you', seems to me the same rule applies. If you have to ask, then the answer is 'no'.

            Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

            1 Reply Last reply
            0
            • G Graham Bradshaw

              Jason Stern wrote:

              Re: am I doing it right??

              Not at all. You seem to have associated "government" with "class". What on earth were you thinking? There are also a bug in your code:

              Jason Stern wrote:

              throw new MoneyAtIt();

              This should be: throw taxpayers' MoneyAtIt(); Furthermore, your whole design and implementation seems to be predicated on the concept that the government is running the economy. To date, no evidence has been presented to support this wild premise.

              D Offline
              D Offline
              DaveX86
              wrote on last edited by
              #11

              Graham Bradshaw wrote:

              This should be: throw taxpayers' MoneyAtIt();

              ...couldn't you just use a cast? throw (taxpayers) MoneyAtIt();

              K E 2 Replies Last reply
              0
              • M Mladen Jankovic

                And what if OutOfMemoryMoney exception occurs? How can you throw more money when don't have any? Oh, wait you can that's why we're discussing it now :)

                [Genetic Algorithm Library]

                R Offline
                R Offline
                Russell Jones
                wrote on last edited by
                #12

                try { ... } catch (OutOfMoneyException ex) { Economy.Money.Print(); } Is the normal way!

                1 Reply Last reply
                0
                • D DaveX86

                  Graham Bradshaw wrote:

                  This should be: throw taxpayers' MoneyAtIt();

                  ...couldn't you just use a cast? throw (taxpayers) MoneyAtIt();

                  K Offline
                  K Offline
                  kirankss
                  wrote on last edited by
                  #13

                  Hmm this sounds like a better way of doing it!!!

                  1 Reply Last reply
                  0
                  • D DaveX86

                    Graham Bradshaw wrote:

                    This should be: throw taxpayers' MoneyAtIt();

                    ...couldn't you just use a cast? throw (taxpayers) MoneyAtIt();

                    E Offline
                    E Offline
                    El Corazon
                    wrote on last edited by
                    #14

                    David Lockwood wrote:

                    ...couldn't you just use a cast?

                    yes and no.... you aren't changing congress money into taxpayer's money. The money's original type is taxpayers, therefore, you would have to cast the taxpayers money into congressional budget money, or debt money, or something. :) At least when I spend it there is always something to get back.... so maybe it should be casting it into a black hole....

                    _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb) John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."

                    D 1 Reply Last reply
                    0
                    • E El Corazon

                      David Lockwood wrote:

                      ...couldn't you just use a cast?

                      yes and no.... you aren't changing congress money into taxpayer's money. The money's original type is taxpayers, therefore, you would have to cast the taxpayers money into congressional budget money, or debt money, or something. :) At least when I spend it there is always something to get back.... so maybe it should be casting it into a black hole....

                      _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb) John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."

                      D Offline
                      D Offline
                      DaveX86
                      wrote on last edited by
                      #15

                      Sort of like MoneyAtIt = Nothing ...in Visual Basic?

                      1 Reply Last reply
                      0
                      • R Rick York

                        This reminds of an old favorite : If con is the opposite of pro then what is the opposite of progress ?

                        S Offline
                        S Offline
                        Scott Barbour
                        wrote on last edited by
                        #16

                        Then there's "poli" meaning many, and "tics" meaning blood-sucking creatures. :laugh:

                        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