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. Amending or Adding Code to something you inherited (SQL)

Amending or Adding Code to something you inherited (SQL)

Scheduled Pinned Locked Moved The Lounge
databasedesignquestion
13 Posts 9 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.
  • realJSOPR realJSOP

    If it works, leave it alone.

    ".45 ACP - because shooting twice is just silly" - JSOP, 2010
    -----
    You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
    -----
    When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

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

    Not if it doesn't work well.

    realJSOPR 1 Reply Last reply
    0
    • M MarcusCole6833

      Do you want to re design the wheel, happy to keep it working ,put your spin or twist on it, if it is a monster make it your monster?

      Greg UtasG Offline
      Greg UtasG Offline
      Greg Utas
      wrote on last edited by
      #5

      If it's something that I've truly inherited, I'd often start by reformatting it. This rather mindless exercise helps me understand how it works, whether it's well designed, and most importantly, makes it less annoying to look at. :laugh: If it needs enhancing, the question is how much. If it's important code that will continue to evolve, I'd typically do some refactoring when adding new capabilities. (This has nothing to do with SQL, which I've never touched.)

      <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
      <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

      M L 2 Replies Last reply
      0
      • P PIEBALDconsult

        Not if it doesn't work well.

        realJSOPR Offline
        realJSOPR Offline
        realJSOP
        wrote on last edited by
        #6

        If you’re not tasked to work on it, leave it alone.

        ".45 ACP - because shooting twice is just silly" - JSOP, 2010
        -----
        You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
        -----
        When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

        1 Reply Last reply
        0
        • Greg UtasG Greg Utas

          If it's something that I've truly inherited, I'd often start by reformatting it. This rather mindless exercise helps me understand how it works, whether it's well designed, and most importantly, makes it less annoying to look at. :laugh: If it needs enhancing, the question is how much. If it's important code that will continue to evolve, I'd typically do some refactoring when adding new capabilities. (This has nothing to do with SQL, which I've never touched.)

          M Offline
          M Offline
          MadMyche
          wrote on last edited by
          #7

          I have inherited quite a bit of SQL that has been worked in who knows what text editor with no format whatsoever. If I need to troubleshoot it I will reformat it so that I can read and understand it

          Director of Transmogrification Services Shinobi of Query Language Master of Yoda Conditional

          1 Reply Last reply
          0
          • Greg UtasG Greg Utas

            If it's something that I've truly inherited, I'd often start by reformatting it. This rather mindless exercise helps me understand how it works, whether it's well designed, and most importantly, makes it less annoying to look at. :laugh: If it needs enhancing, the question is how much. If it's important code that will continue to evolve, I'd typically do some refactoring when adding new capabilities. (This has nothing to do with SQL, which I've never touched.)

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

            SQL is much the same, but query's are often shorter than an inherited codebase. Starts with formatting indeed, removing any string manipulations, and throw it in the query plan analyzer.

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

            Greg UtasG 1 Reply Last reply
            0
            • M MarcusCole6833

              Do you want to re design the wheel, happy to keep it working ,put your spin or twist on it, if it is a monster make it your monster?

              R Offline
              R Offline
              Rajesh R Subramanian
              wrote on last edited by
              #9

              Just too many variables to consider before deciding to redo something from scratch, especially if it's some sort of monstrosity. I don't like to do engage in an endeavour like that unless I'm absolutely required to. If it works, leave it the f#%! alone. I've seen a far too much to think otherwise.

              1 Reply Last reply
              0
              • M MarcusCole6833

                Do you want to re design the wheel, happy to keep it working ,put your spin or twist on it, if it is a monster make it your monster?

                Sander RosselS Offline
                Sander RosselS Offline
                Sander Rossel
                wrote on last edited by
                #10

                I usually apply the boy scout rule, leave the code better than I found it. If I'm just doing a quick fix or if I'm part of a team I'll use the existing formatting and conventions, if I've inherited it I'll start using my own and change existing ones. I might do some refactoring and probably some variable renaming. Hopefully, one day, it'll be a piece of art (wishful thinking, but I need a bit of hope to continue on such projects) :laugh:

                Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly

                1 Reply Last reply
                0
                • M MarcusCole6833

                  Do you want to re design the wheel, happy to keep it working ,put your spin or twist on it, if it is a monster make it your monster?

                  J Offline
                  J Offline
                  Johnny J
                  wrote on last edited by
                  #11

                  I'd rather create my own monster than take over someone elses, thank you very much! :doh:

                  Anything that is unrelated to elephants is irrelephant
                  Anonymous
                  -----
                  The problem with quotes on the internet is that you can never tell if they're genuine
                  Winston Churchill, 1944
                  -----
                  Never argue with a fool. Onlookers may not be able to tell the difference.
                  Mark Twain

                  1 Reply Last reply
                  0
                  • L Lost User

                    SQL is much the same, but query's are often shorter than an inherited codebase. Starts with formatting indeed, removing any string manipulations, and throw it in the query plan analyzer.

                    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                    Greg UtasG Offline
                    Greg UtasG Offline
                    Greg Utas
                    wrote on last edited by
                    #12

                    I have found, virtually without exception, that poorly formatted code means a crap design. Either the owner didn't care or there wasn't an owner, and the collective didn't care. On an unrelated topic, I recently realized that anyone with stuff hanging from their rear-view mirror is likely to be a crap driver. Dream catchers, fuzzy dice, rosary beads, little scented cardboard pine trees--it doesn't matter. When I see a vehicle like this in front of me, I start to get wary.

                    <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                    <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                    M 1 Reply Last reply
                    0
                    • Greg UtasG Greg Utas

                      I have found, virtually without exception, that poorly formatted code means a crap design. Either the owner didn't care or there wasn't an owner, and the collective didn't care. On an unrelated topic, I recently realized that anyone with stuff hanging from their rear-view mirror is likely to be a crap driver. Dream catchers, fuzzy dice, rosary beads, little scented cardboard pine trees--it doesn't matter. When I see a vehicle like this in front of me, I start to get wary.

                      M Offline
                      M Offline
                      MarcusCole6833
                      wrote on last edited by
                      #13

                      on an unrelated topic reply: never leave work in an elevator, when you can walk! If it breaks it is your time!!

                      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