DEV Community

Michael Tharrington
Michael Tharrington

Posted on

What's the biggest mistake you've ever made while coding?

I really enjoy reading posts where authors talk through a mistake that they have made and what they learned from it. I find these posts to be really relatable and enjoyable to read. It's nice to hear someone teach you something from a place of humility, and when folks are talking about the lessons they've learned from their own mistakes, they often have an empathetic, approachable tone.

So, with that in mind, what's the biggest mistake you've ever made while coding?

What problems did your mistake cause? How did it happen? And, what did you learn from it?

Latest comments (38)

Collapse
 
moraym profile image
Moray Macdonald

Everybody drops the production database at some point in their career... but only once!

I've made a few howlers in my time but fortunately none that did lasting damage and couldn't be rectified quickly. The mistakes that really stick with me are less in code (where automated tests and manual QA are the norm) and more in architectural mistakes. They don't cause problems as obvious as the production database not being there any more but the cumulative pain of having to live with those decisions for years is far greater than having to hastily restore a backup!

Collapse
 
msk61 profile image
Mohammed El-Afifi • Edited

I was once part of a team responsible for the maintenance of a tool suite. One day we received a change request from our client with a recommendation that the change be implemented in one of the tools in the suite we maintained. However we saw that it was better and easier to introduce the change to another tool, and we did convince the client of our viewpoint. We then proceeded with implementing the change in the tool of our choice, just to find out just one day before the delivery that the change couldn't be completed in the tool of our choice due to some false assumptions we made regarding the tool. Actually we also we found out that the changes would land more seamlessly with the original tool chosen by the client from the outset. We ended up to migrate everything overnight from the tool of our choice to that of the customer's and delivered on the following day the change made to the tool of the customer's choice, of course to their biggest surprise. 🙂

Collapse
 
jrothlander profile image
jrothlander

Stopping to read blogs.

Collapse
 
jrothlander profile image
jrothlander • Edited

Okay, well not really.

One thing I recall from back when I was maybe 12 and just learning to code in GW-BASIC, it was common to put your surge protector under the desk, even in computers labs at schools. You'd be surprised how often you would lean back to streach and step on the power switch before you saved your work.

In college, the dumbest thing (or funniest depending on your perspective) I ever did was write a little runtime-C executable in during my C class to submit a CTRL/ALT/DEL and dropped it in the autoexec in the computer lab and see how people responded. I actually showed it to the prof and we laughted about it and he mentioned doing similar things to coworkers in the past. It would just reboot the machine until you hit CRTL-C. But it was funny to watch people wonder what was going on. I removed it after messing with a few people in class that day. Unfortuantly, someone else thought it was funny and copied it to another computer without me knowing and left it for the computer lab-techs to find, who thought it was a virus, and proceeded to lock the lab down for two days, formatted all of the drives and reinstalled all of the software, then the university drafted a new virus policy for the campus. Pretty harsh when all they had to do was CTRL-C. To this day, I have no idea why my prof didn't make the connection. Maybe he did and like me, just kept quiet. Or maybe he was the one that copied it to the other computers.

But in my professional career? Well, I have my top 100. But I can't pick just one. They are all too special to pick a #1.

Collapse
 
erdo profile image
Eric Donovan

I had some dodgy "retry on network fail" logic in our client android app that accidentally retried twice for each failure (which of course escalated quickly). Tested fine, got pushed to production and then we started getting messages from the server team.

So I basically created a bot army out of our android users and got them to DDOS our own servers 😂

That was a decade ago, but to this day I try and avoid any automatic retries. If it's an option, I much prefer to let the user chose to retry manually

Collapse
 
cyril_ogoh profile image
ogoh cyril

😂😂😂 the ending sounds like ptsd

And yep I have been there

Collapse
 
amersikira profile image
Amer Sikira

It was long time ago, when we were using FTP clients. I accidentally moved everything from root to one of the folders (without realising). This was on the website that counts its visitiors in millions. After the initial shock of everything not working, it took me almost 30 minutes to figure out what was going on. 😅

Collapse
 
differencialx profile image
differencialx

Once I forgot how to breathe

Collapse
 
psysolix profile image
Stefano P

Back in the day when drag n drop SFTP was a real thing… overwriting a folder that crashed a live multi template site (of multiple vendors).. basically crashing 5 insurance sites in a flash 😂

Collapse
 
vulcanwm profile image
Medea

Refusing to learn something new.
For the last 2 years, I was just using Flask to make websites even though I knew that Next.js would definitely be more faster and useful.

Collapse
 
fersa profile image
Ferhat

I am not doing this for long, however my biggest mistake so far was to set up a cronjob wrong. Instead of sending an email to all inactive accounts on the 15th of a month it send an email every minute to all inactive accounts on the 15th of the month. Over 300 people received 600+ email from us.

Collapse
 
darkterminal profile image
Imam Ali Mustofa

Forgot a ☕️ and my 🚬 is burning my desk!

Collapse
 
highcenburg profile image
Vicente G. Reyes • Edited

One of my biggest mistakes was when I was the Lead Backend Dev at Eden Life Care(this startup never launched btw). If I remember correctly, I kept chaning dependencies for authentication/authorization for the project. It came to a point where I actually had to restart the project when I was still the only dev working on it(this was a few days after I started the project - which was a good thing).

Another mistake was not focusing on coding for music. I started playing the guitar when I was 13 and been in a band since I was 15 years old and have just started coding with music.

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

Blowing a capacitor on my monitor while testing a VGA display driver I was writing. Loud bang and a puff of smoke. Oddly, the monitor still worked! 😛

Collapse
 
ant_f_dev profile image
Anthony Fung

Directly coding wise, I was adding to an enum list and thought it would be helpful to add it alphabetically so you'd see it when scanning the list. This gave the enums different values as they were assigned automatically as incrementing values. Very strange program behaviour followed.

Related to coding but not exactly, I almost lost two weeks worth of work by not know what I was doing in Git

Collapse
 
jesondervin profile image
Jeson • Edited

Delete from tablename ...was not my dev environnement 😥

Collapse
 
syeo66 profile image
Red Ochsenbein (he/him)

UPDATE users SET password='...';

Collapse
 
bad_request400 profile image
Bad Request 400

Ah yeah... the plain text passwords.

How i miss them (somewhat).
It was so easy and convenient.
Now every password is hashed before so writing it directly to db is not an option anymore.

Alternate route: Hash Api Endpoint which takes plaintext as body and returns the hash.
Not as convinient but it works :D

so long

Collapse
 
syeo66 profile image
Red Ochsenbein (he/him)

Actually, the passwords were hashed, and I was actually using the hashing function to get the new passwords string... did not help anything in this case. 🤣

Collapse
 
devfranpr profile image
DevFranPR

Is this a mistake or a good way to remind your users to change the password ? 🤣

Collapse
 
syeo66 profile image
Red Ochsenbein (he/him)

Well, we sold it as a security feature to our users... 🤣

Thread Thread
 
devfranpr profile image
DevFranPR

Wonderful