Tbh, I usually inform myself and use tooling which is considered good. But even so, I made some really strange experiences, especially with debuggers...
What are some of your snippets which just refuse to work with your tooling or are so very stupid, that you would rewrite them this instant, if only that program would still be relevant? Let's learn from mistakes :D
I was debugging a DFP ad slot on a popular classifieds website and in order to spot the slot, I added a simple H1 with the words "FOOBOO".
For whatever reason I got distracted. Probably a meeting. Came back, started working on another task, committed, pushed, ran the build/deploy script, the whole sha-bang.
An hour or two later, I hear a few of the advertising people strike up a conversation going along the lines of "What's fooboo?", "Oh, it's an clothing label.", "Why are they on our site?!".
Felt like the longest hour while waiting for everything to build and deploy again.
Don't serve me a beer on this one, but I once came home from party and wanted to do some minor fixes on an application I was working on. This was before I used any version control. The next day I realised that I had made so many mistakes on my heavily drunk night, that the program was impossible to rescue. I had to delete the whole thing and start over 😂
Not necessarily a piece of code, so much as a decision on a backend service.
2 years ago when I switched from MySQL to Firebase, I went all in. I moved everything to Firebase. For a while, it was great, but as usual, 3rd party services make (breaking) changes and have their own problems. Now, I'm backing away from Firebase and going back to MySQL. I'll keep Firebase around for "some" non-mission critical features, but the majority of the system is slowly being re-written in PHP / MySQL, again.
The website is just to important to me to leave it in the hands of a proprietary 3rd party service that I can't move to a different server / stop a feature from being implemented or whatever.
Here are mine:
noOne of my powershell scripts syncs mail certificates from our ADAM to our AD. It might be one of my most hated scripts, as there are so many special cases and places where the script or its tooling just breaks or runs into trouble, because some team changed some stuff in places. But the worst part is the tooling, which just fails.
function do_something() {
# 20 lines of fetching an AD contact or creating one if it does not exist.
# $objADSI contains the AD Object
# $c contains a row of an imported CSV file
$r = new PSObject -Property @{# The ISE crashes when I return the new object directly.
ADEntry = $objADSI
CSVEntry = $c
}
return $r
}
One of my C# applications displays a splashscreen while doing stuff in the background. In order to display the splashscreen, I spawn a new thread which also fuels a little animation and just shows the user that the application is working. At one point, I want to display a modal message, so I get the splashscreen's handler from the second thread (with proper lock) and display the message. Turns out the debugger has some serious issues with my code...
lock (splash)
{
try
{
MessageBox.Show(
splash,
"This is the first time you start this application... // and more text here",
"First Time Notice",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
catch (Exception ex)
{
// The debugger will throw an error and while debugging the message will _not_ be displayed because splash was created in another thread.
// When executed without a debugger, this piece of code executes just fine and does what it should.
// Personally, I think it's stupid that the debugger does not recognize the lock construction and just executes the code.
// But well... whatever. Who knows how long we will be using this tool either way.
}
}
Oh, and by the way, it's an old tool which really is not used any more. So the last sentence of the original comment is quite funny :D
Wendy Sanarwanto
Freelance Software Engineer, Team Lead & Analyst at Reputable Outsource Company in Indonesia
Scolded in harsh way by my Project manager in front of customer's representatives such as Senior managers, officers and their underlings during uat. It was due to SQL SP scripts that went wrong , giving undesired result and it was written by me.