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. have you ever been stuck on a programming problem

have you ever been stuck on a programming problem

Scheduled Pinned Locked Moved The Lounge
helpdatabasequestion
57 Posts 36 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 David Days

    Had problem like that--"legacy" web app written in some third party take on ASP.NET and JSP. It was "legacy" in that the code was written before we took over a contract by another contractor (so no going back to them without major $$), but it was only a year old. Now that we were responsible, the users were asking that we fix the weird issue of extremely poor performance and daily lockups of the entire system. I was given the task of figuring out how the code worked so I could go through and fix it. When I finally get the source code installed and 3rd party IDE up..."Hmmm...almost zero logic in the code as far as I can tell...these are strange calls..." I go look in the database, and voila! All stored procedures. I tell myself, "Okay, I can work with this!", and start scrolling through a stored procedure... ...and scrolling... ...and scrolling... ...and scrolling... Oh My Elephanting God! One stored procedure (the one that was suspected in causing the lockup) was 12,000 lines! And there were 30 more! Tried printing it out to do a manual refactoring--it was 250 pages of stored procedure SQL, and there was no consistency in anything. My final report back was this: 1. This is a horrible app. 2. If you want it "fixed", I need 6 weeks and the option to just rewrite the whole thing in a more stable and common language (.NET, JSP, assembler, whatever...I didn't care--anything would be better than this nightmarish blend of old ASP and Black Speech). 3. If you want it to run "better", move it to a big iron database (we had several) and don't look at it until you want to rewrite it. They went with option #3. Every 6-8 months, I would be told to take another look, and occasionally I would be able to make a small modification that wouldn't crash the whole system. I left a few years later, and as far as I know, it's still out there, a monument to both Horrible Implementation and "The problem I couldn't crack".

    vuolsi così colà dove si puote ciò che si vuole, e più non dimandare --The answer to Minos and any question of "Why are we doing it this way?"

    G Offline
    G Offline
    GuyThiebaut
    wrote on last edited by
    #45

    Thanks for that! 12,000 line of code in one stored procedure - I don't think that pachyderm goes far enough in describing how horrendous that must have been.

    David Days wrote:

    no consistency in anything

    - that's probably the worst part, although anyone who writes a 12,000 line stored procedure is unlikely to be very well organised. Glad they listened to you.

    “That which can be asserted without evidence, can be dismissed without evidence.”

    ― Christopher Hitchens

    1 Reply Last reply
    0
    • K Kirk 10389821

      We had a Star Trek game. It was run on PAPER Terminals. I have to admit that I did not have the patience required. I would rather rewrite the system startup routines in Macro-11 Assembler. :-)

      M Offline
      M Offline
      Member 11369863
      wrote on last edited by
      #46

      An old Ohio(?) Scientific binary adder. My teacher had the kit I think for sometime. One day she just looked at me and said, "Here. This is for you." I've been a geek with a receding hairline since the sixth grade. I've never looked back. Re: That routine CFH - kill, crush, destroy (or refactor/rewrite).

      M 1 Reply Last reply
      0
      • B BruceN

        (This will probably result in a ban, but whatever) So bizarre, so obtuse you just can't see the answer? I got blindsided and walked into a legacy project I swear was written by Martians. We have such gems as magic numbers: return code 97. WTF? Or let's change the code based on the return value of a frick'n button that you just changed the text on: Ok becomes Done, for no reason in the thinking universe I've been banging my head against the wall for the last 6 months over a damn print routine, which is called all over the place, but is rewritten 3 different ways. And don't get me started on the database side of things. It's possible, and happens on a daily basis, to enter a completely illogical combination of products, suppliers and customers and insert that into the db in such a way as to f*** everything over for the next thousand years. You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this [redacted] fustercluck. Edits: [Bertschi]Redacted swearing [/Bertschi]

        P Offline
        P Offline
        patbob
        wrote on last edited by
        #47

        Rather than rant, you could just do like me and my coworker did once -- named an award of coding shame after the former engineer and passed it around for years whenever we caught each other, or ourselves, doing something so stupid.

        We can program with only 1's, but if all you've got are zeros, you've got nothing.

        1 Reply Last reply
        0
        • M Member 11369863

          An old Ohio(?) Scientific binary adder. My teacher had the kit I think for sometime. One day she just looked at me and said, "Here. This is for you." I've been a geek with a receding hairline since the sixth grade. I've never looked back. Re: That routine CFH - kill, crush, destroy (or refactor/rewrite).

          M Offline
          M Offline
          Member 11369863
          wrote on last edited by
          #48

          Ok. Maybe it wasn't Ohio Scientific. It looked pretty much like this though:

          M 1 Reply Last reply
          0
          • M Member 11369863

            Ok. Maybe it wasn't Ohio Scientific. It looked pretty much like this though:

            M Offline
            M Offline
            Member 11369863
            wrote on last edited by
            #49

            Picture

            1 Reply Last reply
            0
            • B BruceN

              (This will probably result in a ban, but whatever) So bizarre, so obtuse you just can't see the answer? I got blindsided and walked into a legacy project I swear was written by Martians. We have such gems as magic numbers: return code 97. WTF? Or let's change the code based on the return value of a frick'n button that you just changed the text on: Ok becomes Done, for no reason in the thinking universe I've been banging my head against the wall for the last 6 months over a damn print routine, which is called all over the place, but is rewritten 3 different ways. And don't get me started on the database side of things. It's possible, and happens on a daily basis, to enter a completely illogical combination of products, suppliers and customers and insert that into the db in such a way as to f*** everything over for the next thousand years. You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this [redacted] fustercluck. Edits: [Bertschi]Redacted swearing [/Bertschi]

              F Offline
              F Offline
              fglenn
              wrote on last edited by
              #50

              I feel for you. Probably the worst code I ever worked on was a real-time program where the apparently nonsensical sequence of events had a real-world impact that was not immediately obvious. :)

              Fletcher Glenn

              1 Reply Last reply
              0
              • B BruceN

                (This will probably result in a ban, but whatever) So bizarre, so obtuse you just can't see the answer? I got blindsided and walked into a legacy project I swear was written by Martians. We have such gems as magic numbers: return code 97. WTF? Or let's change the code based on the return value of a frick'n button that you just changed the text on: Ok becomes Done, for no reason in the thinking universe I've been banging my head against the wall for the last 6 months over a damn print routine, which is called all over the place, but is rewritten 3 different ways. And don't get me started on the database side of things. It's possible, and happens on a daily basis, to enter a completely illogical combination of products, suppliers and customers and insert that into the db in such a way as to f*** everything over for the next thousand years. You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this [redacted] fustercluck. Edits: [Bertschi]Redacted swearing [/Bertschi]

                Y Offline
                Y Offline
                Ygnaiih
                wrote on last edited by
                #51

                Try a project written by a sucksession of contractors all of whom codded differently badly with simple aspx pages with 2k+ line code behinds. The contractors are long gone. Then anyone with even passing knowledge of how the application works doesn't have time to waste on explaining fertilizer ( think organic) to you. Can you get this done by tomorrow?

                1 Reply Last reply
                0
                • B BruceN

                  (This will probably result in a ban, but whatever) So bizarre, so obtuse you just can't see the answer? I got blindsided and walked into a legacy project I swear was written by Martians. We have such gems as magic numbers: return code 97. WTF? Or let's change the code based on the return value of a frick'n button that you just changed the text on: Ok becomes Done, for no reason in the thinking universe I've been banging my head against the wall for the last 6 months over a damn print routine, which is called all over the place, but is rewritten 3 different ways. And don't get me started on the database side of things. It's possible, and happens on a daily basis, to enter a completely illogical combination of products, suppliers and customers and insert that into the db in such a way as to f*** everything over for the next thousand years. You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this [redacted] fustercluck. Edits: [Bertschi]Redacted swearing [/Bertschi]

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

                  Hmmm... If you know what the program's supposed to do, then I'd advise you to delete it and write a new one... by the time you figure out how this crap works, you might as well have done that anyway.

                  1 Reply Last reply
                  0
                  • B Brad Stiles

                    BruceN wrote:

                    So bizarre, so obtuse you just can't see the answer?

                    I've been with the same company for 20 years now, and I've seen this many times. You know the something even worse? When you realize that you wrote the bizarre, obtuse code in question...

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

                    Ohhhhhh.....!!

                    1 Reply Last reply
                    0
                    • E Espen Harlinn

                      try del /F /S /Q *.* or rmdir /S /Q Then rewrite everything from scratch ...

                      Espen Harlinn Chief Architect - Powel AS Projects promoting programming in "natural language" are intrinsically doomed to fail. Edsger W.Dijkstra

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

                      Concur!

                      1 Reply Last reply
                      0
                      • B BruceN

                        (This will probably result in a ban, but whatever) So bizarre, so obtuse you just can't see the answer? I got blindsided and walked into a legacy project I swear was written by Martians. We have such gems as magic numbers: return code 97. WTF? Or let's change the code based on the return value of a frick'n button that you just changed the text on: Ok becomes Done, for no reason in the thinking universe I've been banging my head against the wall for the last 6 months over a damn print routine, which is called all over the place, but is rewritten 3 different ways. And don't get me started on the database side of things. It's possible, and happens on a daily basis, to enter a completely illogical combination of products, suppliers and customers and insert that into the db in such a way as to f*** everything over for the next thousand years. You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this [redacted] fustercluck. Edits: [Bertschi]Redacted swearing [/Bertschi]

                        B Offline
                        B Offline
                        Bruce Patin
                        wrote on last edited by
                        #55

                        You didn't say how legacy "legacy" is, but there are always logical reasons for these things. The first reason is that someone was making changes and didn't get around to making the change everywhere. The meaning of the magic code 97 can be found on a note pasted under the system operator's keyboard. The print routine call is a masterpiece of software engineering that allows you to call different routines with the same code. You have a remarkably stable database to be able to stand firm for a thousand years. I would be grateful. The toga might be allowed on some casual Fridays. I would check into it.

                        1 Reply Last reply
                        0
                        • B BruceN

                          (This will probably result in a ban, but whatever) So bizarre, so obtuse you just can't see the answer? I got blindsided and walked into a legacy project I swear was written by Martians. We have such gems as magic numbers: return code 97. WTF? Or let's change the code based on the return value of a frick'n button that you just changed the text on: Ok becomes Done, for no reason in the thinking universe I've been banging my head against the wall for the last 6 months over a damn print routine, which is called all over the place, but is rewritten 3 different ways. And don't get me started on the database side of things. It's possible, and happens on a daily basis, to enter a completely illogical combination of products, suppliers and customers and insert that into the db in such a way as to f*** everything over for the next thousand years. You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this [redacted] fustercluck. Edits: [Bertschi]Redacted swearing [/Bertschi]

                          O Offline
                          O Offline
                          obermd
                          wrote on last edited by
                          #56

                          That's my code you're complaining about. :~ Seriously though, I've run into code like this and you're almost better off rewriting from scratch when it's this bad.

                          1 Reply Last reply
                          0
                          • B BruceN

                            (This will probably result in a ban, but whatever) So bizarre, so obtuse you just can't see the answer? I got blindsided and walked into a legacy project I swear was written by Martians. We have such gems as magic numbers: return code 97. WTF? Or let's change the code based on the return value of a frick'n button that you just changed the text on: Ok becomes Done, for no reason in the thinking universe I've been banging my head against the wall for the last 6 months over a damn print routine, which is called all over the place, but is rewritten 3 different ways. And don't get me started on the database side of things. It's possible, and happens on a daily basis, to enter a completely illogical combination of products, suppliers and customers and insert that into the db in such a way as to f*** everything over for the next thousand years. You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this [redacted] fustercluck. Edits: [Bertschi]Redacted swearing [/Bertschi]

                            R Offline
                            R Offline
                            R Erasmus
                            wrote on last edited by
                            #57

                            Sounds like the problems I face on a day to day basis... What I try to do is first of all figure out what is required of me. Then, very carefully inject what I need to do somewhere that looks appropriate. The key is to move things around but keep what is does and when it does it.

                            "Program testing can be used to show the presence of bugs, but never to show their absence." << please vote!! >>

                            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