Amending or Adding Code to something you inherited (SQL)
-
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, 2013Not if it doesn't work well.
-
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?
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.)
-
Not if it doesn't work well.
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 -
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.)
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
-
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.)
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.
-
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?
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.
-
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?
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
-
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?
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 -
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.
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.
-
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.
on an unrelated topic reply: never leave work in an elevator, when you can walk! If it breaks it is your time!!