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. The Daily WTF

The Daily WTF

Scheduled Pinned Locked Moved The Lounge
com
28 Posts 14 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.
  • N NormDroid

    He should of opted for: public static long Factorial(long fact) { return fact == 1 ? fact : fact * Factorial(fact-1); } hope nobodies watching or this could end up answering some kiddies homework ;)

    P Think of the environment; please don't print this message unless you really need to.

    M Offline
    M Offline
    Matthew Bache
    wrote on last edited by
    #19

    norm .net wrote:

    return fact == 1 ? fact : fact * Factorial(fact-1);

    what about the case of 0! = 1 I think you just ploughed into a stack overflow. :-D

    Matt

    if ( ! pMatt->isEnjoying("Sales") )
    {
    pMatt->retrain("Computer Science");
    pMatt->getNewJob("Developer");
    }

    N 1 Reply Last reply
    0
    • M Matthew Bache

      norm .net wrote:

      return fact == 1 ? fact : fact * Factorial(fact-1);

      what about the case of 0! = 1 I think you just ploughed into a stack overflow. :-D

      Matt

      if ( ! pMatt->isEnjoying("Sales") )
      {
      pMatt->retrain("Computer Science");
      pMatt->getNewJob("Developer");
      }

      N Offline
      N Offline
      NormDroid
      wrote on last edited by
      #20

      Whhops didn't read your post :-O

      P Think of the environment; please don't print this message unless you really need to.

      1 Reply Last reply
      0
      • M Marc Clifton

        Jerry Hammond wrote:

        but in the context of your post your misspelling of disgusting is disgusting.

        :) I thought it looked odd, but couldn't think of why. Chalk it up to that old age disease I won't try spelling write now. Marc

        Thyme In The Country
        Interacx
        My Blog

        J Offline
        J Offline
        Jerry Hammond
        wrote on last edited by
        #21

        Commonly known as a +40 moment.

        "We are all repositories for genetically-encoded information that we're all spreading back and forth amongst each other, all the time. We're just lousy with information." - Neal Stephenson

        1 Reply Last reply
        0
        • M Mark Salsbery

          O M G :wtf: This one has to hold the record for most WTFs in the comments :laugh: Worse Than Failure[^]

          "Go that way, really fast. If something gets in your way, turn."

          M Offline
          M Offline
          Matt Newman
          wrote on last edited by
          #22

          Under pressure I probably would have had problems remembering how to do factorial because I haven't done in in like 3 years... That said the last time I did do it, I did it in MIPS Assembly (which could not have been any less fun).

          Please visit http://www.readytogiveup.com/ and do something special today.

          -Matt Newman

          D M 2 Replies Last reply
          0
          • M Matt Newman

            Under pressure I probably would have had problems remembering how to do factorial because I haven't done in in like 3 years... That said the last time I did do it, I did it in MIPS Assembly (which could not have been any less fun).

            Please visit http://www.readytogiveup.com/ and do something special today.

            -Matt Newman

            D Offline
            D Offline
            Dan Neely
            wrote on last edited by
            #23

            Matt Newman wrote:

            MIPS Assembly (which could not have been any less fun).

            :rose: MY sympathies. I had to do MIPS assembly in college too. While I fully understand not wanting to deal with the cheating that x86 would allow I can't think of any more useless language to've learned. Was the emulator still a pile of dog turds when you suffered through it?

            -- You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer

            M 1 Reply Last reply
            0
            • D Dan Neely

              Matt Newman wrote:

              MIPS Assembly (which could not have been any less fun).

              :rose: MY sympathies. I had to do MIPS assembly in college too. While I fully understand not wanting to deal with the cheating that x86 would allow I can't think of any more useless language to've learned. Was the emulator still a pile of dog turds when you suffered through it?

              -- You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer

              M Offline
              M Offline
              Matt Newman
              wrote on last edited by
              #24

              dan neely wrote:

              Was the emulator still a pile of dog turds when you suffered through it?

              Yes, yes it was!

              Please visit http://www.readytogiveup.com/ and do something special today.

              -Matt Newman

              1 Reply Last reply
              0
              • L llamadillo

                My favorite part about the reader comments is how so many of them - confidently - misunderstand the code they're ripping apart. You don't get that much around here. Most of the posters are able to programmatically tie their shoes, so to speak.

                M Offline
                M Offline
                Mark Salsbery
                wrote on last edited by
                #25

                llamadillo wrote:

                My favorite part about the reader comments is how so many of them - confidently - misunderstand the code they're ripping apart.

                Exactly! I don't always read the comments, so maybe it happens more than I know, but there seemed to be an excessive amount of those in that post :) Cheers, Mark

                "Go that way, really fast. If something gets in your way, turn."

                D 1 Reply Last reply
                0
                • N NormDroid

                  He should of opted for: public static long Factorial(long fact) { return fact == 1 ? fact : fact * Factorial(fact-1); } hope nobodies watching or this could end up answering some kiddies homework ;)

                  P Think of the environment; please don't print this message unless you really need to.

                  M Offline
                  M Offline
                  Mark Salsbery
                  wrote on last edited by
                  #26

                  :-D

                  "Go that way, really fast. If something gets in your way, turn."

                  1 Reply Last reply
                  0
                  • M Matt Newman

                    Under pressure I probably would have had problems remembering how to do factorial because I haven't done in in like 3 years... That said the last time I did do it, I did it in MIPS Assembly (which could not have been any less fun).

                    Please visit http://www.readytogiveup.com/ and do something special today.

                    -Matt Newman

                    M Offline
                    M Offline
                    Mark Salsbery
                    wrote on last edited by
                    #27

                    Matt Newman wrote:

                    MIPS Assembly

                    Hmmm....I wonder if that's the assembly I learned in college. It was so long ago I have no idea! I do remember I was doing Z80 assembly as a hobby and driving the professor nuts with questions totally unrelated to the course :) Cheers! Mark

                    "Go that way, really fast. If something gets in your way, turn."

                    1 Reply Last reply
                    0
                    • M Mark Salsbery

                      llamadillo wrote:

                      My favorite part about the reader comments is how so many of them - confidently - misunderstand the code they're ripping apart.

                      Exactly! I don't always read the comments, so maybe it happens more than I know, but there seemed to be an excessive amount of those in that post :) Cheers, Mark

                      "Go that way, really fast. If something gets in your way, turn."

                      D Offline
                      D Offline
                      Dan Neely
                      wrote on last edited by
                      #28

                      Mark Salsbery wrote:

                      llamadillo wrote: My favorite part about the reader comments is how so many of them - confidently - misunderstand the code they're ripping apart. Exactly! I don't always read the comments, so maybe it happens more than I know, but there seemed to be an excessive amount of those in that post

                      I see that sort of thing almost everytime I read comments about WTFy homework/interview code.

                      -- You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer

                      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