Late 90's, I'm lead dev for a large site. Company hires a DBA. We partner with a VERY large content provider. I'm awake for 48 hours buttoning things up, last minute stuff. I finally collapse from exhaustion only to be woken up at 7am on - go live day. Nothing works. A few moments debugging reveals that all the column names in a key set of our datasets have been renamed. No time to waste, I rename them all back as qu…
>We contact the DBA and explain the folly of his decision. >He then proceeds to rename everything AGAIN on a live system. What could his reasoning possibly be? Did he not understand your explanation?
Times I've Messed Up as a Developer
91–100 of 137 posts
Re: Times I've Messed Up as a Developer
#92Earlier quoted context omitted.
This is why I do a "mv" to "tmp" instead of using "rm" when I can. Having special messages or colours to differentiate between production and other environments is a great idea as well. Generally if I'm about to do something on production, I'll close everything else to do with other environments as it's just too easy to slip up.
You can also alias "rm -i" or "rm -I" to "rm" to avert major catastrophes. From man rm: -i prompt before every removal -I prompt once before removing more than three files, or when removing recursively; less intrusive than -i, while still giving protection against most mistakes
Re: Times I've Messed Up as a Developer
#93Once I refactored some stringly typed C# code to use an enum with values Prod and Test instead of the two strings "Prod" and "Test". I was relying on expressions like mode == "Test" to fail to type-check to spot all the places that I needed to update. Sadly some parts of the codebase weren't very idiomatic and had some "Test".Equals(mode) This caused a bit of involuntary testing in production and thought me not to tr…
I'm going to steal that one.
Re: Times I've Messed Up as a Developer
#94Earlier quoted context omitted.
This is why I do a "mv" to "tmp" instead of using "rm" when I can. Having special messages or colours to differentiate between production and other environments is a great idea as well. Generally if I'm about to do something on production, I'll close everything else to do with other environments as it's just too easy to slip up.
my go-to .bashrc hashes the hostname into a color and prints the prompt in that color. it has saved me from making a dumb mistake a few times.
Staging prompts are yellow.
Development prompts are green.
Re: Times I've Messed Up as a Developer
#95Earlier quoted context omitted.
my go-to .bashrc hashes the hostname into a color and prints the prompt in that color. it has saved me from making a dumb mistake a few times.
Could you post the code somewhere?
https://gist.github.com/woodrowbarlow/52b02ab27d0f8088891c3d...
look at `get_hash_color`.
Re: Times I've Messed Up as a Developer
#96My boss wasn't happy.
Re: Times I've Messed Up as a Developer
#97Earlier quoted context omitted.
This 'default' behaviour strikes me as one of SQL's worst faults. If you want to delete all rows, you should be made to explicitly type out that intention.
I'd say require a WHERE on deletes. If you want "WHERE true" that's fine, but require a WHERE.
Re: Times I've Messed Up as a Developer
#98Earlier quoted context omitted.
my go-to .bashrc hashes the hostname into a color and prints the prompt in that color. it has saved me from making a dumb mistake a few times.
Production prompts are red. Staging prompts are yellow. Development prompts are green.
Re: Times I've Messed Up as a Developer
#99Earlier quoted context omitted.
Always write DELETEs as SELECTs, and once you run the SELECT and it returns the rows you want, then swap out the SELECT * with a DELETE.
That's good advice in general, not just for SQL. For example, I often write my 'rm' commands as 'ls' at first and then swap out the command once I know it gets the right thing.
Re: Times I've Messed Up as a Developer
#100Earlier quoted context omitted.
Production prompts are red. Staging prompts are yellow. Development prompts are green.
yeah, that'd be great. but our staging units (i don't deal with production units) come and go so often that keeping a list of hostnames became unrealistic.