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. Other Discussions
  3. The Weird and The Wonderful
  4. Is this the worst code in the world?

Is this the worst code in the world?

Scheduled Pinned Locked Moved The Weird and The Wonderful
csshelpquestionlearning
18 Posts 16 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.
  • S Offline
    S Offline
    Sean McPoland 0
    wrote on last edited by
    #1

    this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

    R T P M W 11 Replies Last reply
    0
    • S Sean McPoland 0

      this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

      R Offline
      R Offline
      ravikhoda
      wrote on last edited by
      #2

      :laugh: :laugh: :laugh:

      Ravi Khoda Humanity is the best religion and smile is the best medicine.

      1 Reply Last reply
      0
      • S Sean McPoland 0

        this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

        T Offline
        T Offline
        Tim Carmichael
        wrote on last edited by
        #3

        In regards to testers and, in this case, auditors... A number of years ago, I worked on an ERP application and developed auto-invoice functionality. When an item was received, and invoice would be automatically generated and approved. The auditor wanted to see the various stages on the screen... receive the item (good), generate an invoice (good), APPROVE the invoice (well... it's auto approved, so we can't show you the intermediate step...) and all of this in the production system. I convinced her to watch me perform the actions in the test system because receiving something in production would generate a cheque...

        1 Reply Last reply
        0
        • S Sean McPoland 0

          this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

          P Offline
          P Offline
          Power Puff Boy
          wrote on last edited by
          #4

          This is not the worst code in the world. This is just a tribute to the worst code in the world. I could not remember the worst code in the world. ;P

          Kitty at my foot and I waAAAant to touch it...

          M M 2 Replies Last reply
          0
          • P Power Puff Boy

            This is not the worst code in the world. This is just a tribute to the worst code in the world. I could not remember the worst code in the world. ;P

            Kitty at my foot and I waAAAant to touch it...

            M Offline
            M Offline
            Mark Whybird
            wrote on last edited by
            #5

            LOL!!!

            1 Reply Last reply
            0
            • S Sean McPoland 0

              this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

              M Offline
              M Offline
              Mark Whybird
              wrote on last edited by
              #6

              Could be worse... Did you see the time that testing made a fake best-seller? http://thedailywtf.com/articles/Ive-Got-The-Monkey-Now[^]

              1 Reply Last reply
              0
              • P Power Puff Boy

                This is not the worst code in the world. This is just a tribute to the worst code in the world. I could not remember the worst code in the world. ;P

                Kitty at my foot and I waAAAant to touch it...

                M Offline
                M Offline
                Member 10707677
                wrote on last edited by
                #7

                How about an undocumented testing control that was buried in the scheduler of a number of ERP systems. When ERP was a new buzzword introduced to the market, I embedded the control to enable testing and debugging of the software with customer-supplied data. That code and trigger got replicated in later versions of the system as companies purchased copies of the scheduler to speed development of their systems. When I first started working on ERP scheduling, there were only five systems on the market and I had contracts with three of the companies to tweak my original software. Every so often, I hear reports of some scheduling process going bananas and dumping screeds of garbage to whatever device is used to output from the process.

                The difficult may take time, the impossible a little longer.

                1 Reply Last reply
                0
                • S Sean McPoland 0

                  this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

                  W Offline
                  W Offline
                  Weston Miller
                  wrote on last edited by
                  #8

                  I'm pretty sure mine is the worst...

                  1 Reply Last reply
                  0
                  • S Sean McPoland 0

                    this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

                    K Offline
                    K Offline
                    Kirk 10389821
                    wrote on last edited by
                    #9

                    My recent was some RPG code that did ROUGHLY this: MINS = 'XX' of minutes IF (MINS='09' OR MINS='19' OR MINS='29'.. OR MINS='59' or MINS='99') THEN ... When I questioned this, I was told that they discovered sometimes it returns 99. To which I laughed. I suggested: MIN = 'X' of minutes (last digit) IF (MIN='9') THEN ... ... For the record, they pushed back and the code was not fixed! Fast forward a couple of years. They are no longer in business!

                    1 Reply Last reply
                    0
                    • S Sean McPoland 0

                      this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

                      M Offline
                      M Offline
                      Member_5893260
                      wrote on last edited by
                      #10

                      Well, I guess it could be worse... what if the "wait" had been left out? I dread to think what the load on the machine's CPU would've been like...

                      M 1 Reply Last reply
                      0
                      • M Member_5893260

                        Well, I guess it could be worse... what if the "wait" had been left out? I dread to think what the load on the machine's CPU would've been like...

                        M Offline
                        M Offline
                        Member_5893260
                        wrote on last edited by
                        #11

                        ...although, thinking about it, arguably the worst code in the world came about as a result of an undocumented instruction in the 80286 which Intel originally included for testing. The way the instruction worked, you filled up an area in page 0 of memory with all the values you wanted all the registers in the chip to have (including instruction pointer, stack pointer, flags, etc.) and whether you wanted to run in real mode (640K) or extended mode (all the memory available) and where in the larger memory map you wanted your 640K to be... and so on - and then you could execute the instruction and the chip would cold-start in that state. The worst code in the world that I'm talking about, then, was the first version of OS/2, written for that chip, which allowed you to have one - and only one - DOS window running at any time. And - yes - IBM made that work by hooking onto Interrupt 8 (the hardware timer) and cold-starting the 80286 eighteen times a second, flipping between real mode and extended mode each time around. Horrible. Amazingly, it actually worked... I shudder to think what the chipset around the chip was thinking at the time, but there it is.

                        1 Reply Last reply
                        0
                        • S Sean McPoland 0

                          this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

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

                          Rather than post the worst I've seen, yet again: http://www.codeproject.com/Messages/2227888/Re-Type-conversion.aspx[^] http://www.codeproject.com/Messages/3496420/Re-useless.aspx[^]

                          1 Reply Last reply
                          0
                          • S Sean McPoland 0

                            this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

                            B Offline
                            B Offline
                            BrainiacV
                            wrote on last edited by
                            #13

                            No, the worst code in the world is Programming Horror. From the original Micro Lab Data Factory database program written in Applesoft Basic. We had this nailed to the wall as a warning to others.

                            Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

                            M J 2 Replies Last reply
                            0
                            • B BrainiacV

                              No, the worst code in the world is Programming Horror. From the original Micro Lab Data Factory database program written in Applesoft Basic. We had this nailed to the wall as a warning to others.

                              Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

                              M Offline
                              M Offline
                              Manfred Rudolf Bihy
                              wrote on last edited by
                              #14

                              "If you can understand this code you're fired!" So wrong on so many levels! X|

                              "I had the right to remain silent, but I didn't have the ability!"

                              Ron White, Comedian

                              1 Reply Last reply
                              0
                              • B BrainiacV

                                No, the worst code in the world is Programming Horror. From the original Micro Lab Data Factory database program written in Applesoft Basic. We had this nailed to the wall as a warning to others.

                                Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

                                J Offline
                                J Offline
                                jibalt
                                wrote on last edited by
                                #15

                                All code used to be written like that. That's a relatively understandable example.

                                1 Reply Last reply
                                0
                                • S Sean McPoland 0

                                  this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

                                  A Offline
                                  A Offline
                                  Al Chak
                                  wrote on last edited by
                                  #16

                                  so sweet! :-O The programm can read the current time but cannot calculate time till 2am!

                                  1 Reply Last reply
                                  0
                                  • S Sean McPoland 0

                                    this was from a year or two ago...really! I was investing a batch scheduling issue using CA-Scheduler. The program in COBOL had the following code (paraphrased as I've forgotten it all). TestTime: If time <> 2am then Wait 1 second Goto testTime End If This program at the beginning of a schedule of 1,200 nightly would start somewhere usually between 11:30 and midnight because of changes to the schedule. It worked like this for 5 years before anyone challenged what was happening with the batch cycle. On review the programmer put the code in because the tester insisted on seeing the code work at 2am...there is no scheduler in developement or UAT, and of course the code never ever came out.... Once fixed the schedule dropped from 9 hours to less than 4.... Go testers!!!

                                    D Offline
                                    D Offline
                                    Dr Gadgit
                                    wrote on last edited by
                                    #17

                                    A long time ago i was known to use something like whilst (1==1) { } then i learned to use whilst (true) { } Happy days :)

                                    B 1 Reply Last reply
                                    0
                                    • D Dr Gadgit

                                      A long time ago i was known to use something like whilst (1==1) { } then i learned to use whilst (true) { } Happy days :)

                                      B Offline
                                      B Offline
                                      BruceN
                                      wrote on last edited by
                                      #18

                                      that just made me laugh out loud

                                      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