2

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

 1 year ago
source link: https://dev.to/michaeltharrington/whats-the-biggest-mistake-youve-ever-made-while-coding-12n2
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg 24 multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg 5 exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg 2 raised-hands-74b2099fd66a39f2d7eed9305ee0f4553df0eb7b4f11b01b6b1b499973048fe5.svg 1 fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg 2

 

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?

Top comments (32)

pic

CollapseExpand

I have made mistakes I hope to never make again.

I have:

  • Deleted production data
  • Pushed some code which actually caused a system-wide infinite loop in the cloud environment. My bug showed up in their status page 😆
  • Made a change which took down DEV for 10+ hours

Harder to sum up, but I've definitely made software design choices which caused problems later, and are still causing problems today. The notorious technical debt.

All of these experiences give me caution which I hope to pass on to others, but it's also important to know that some mistakes are not overly avoiding. As they say in CSS, if everything is !important, nothing is !important. I think mistakes related to data and privacy are the top mistakes to avoid. Any mistake with a known remedy or short-lived impact are not dramatically worth avoiding.

Comment button Reply

CollapseExpand

I had a colleague once who dropped a table of data from live. Luckily it was a relatively new system :)

Comment button Reply

CollapseExpand

So back in the day, I was working for a tech startup in Boston's metro-west area. I was one of the front-end devs, and we were building some great tech that was being fed a transcript via an API. But the boss wanted to get experimental.

"Wouldn't it be great if, as we progress through the transcript, we could pop up related material at a particular time? Say, the transcript mentions Steve Jobs, we pull up his Wikipedia profile and the top five news stories, or it mentions Microsoft, we display their stock ticker, business news, and related content on the fly?"

And yeah, that sounded neat. But let's be real - it was 2007.

So I tried, I found a great early BaaS from Yahoo! called Pipes. Way ahead of its time, but it allowed us to scrape, munge and combine feeds, based on what we passed to a call to a particular pipe. It was a meta-API, of sorts.

So yeah. The first few days of playing with the parts, things were looking very promising. The Pipe was working as I wanted, it could handle different types, it could return different data, and I could consume it however I like. Sweet!

And then at scale. From the live transcript. That's where I broke things.

See, in one way you can take a particular key term at a particular point in time, pass the request, get the data. With a very small change, you can take all the key terms, from all the points in time, and request them all. For each key term. Thousands per minute.

I inadvertently used Yahoo! for an ugly sort of DDoS on multiple search engines and sites. Boss and I had to go to a meeting with numerous tech heads, explain what our code did and why - they were more curious about the use case and the "how and why", and less about blame.

Honestly, I think we learn more from those moments someone breaks stuff.

Comment button Reply

CollapseExpand

This a great anecdote, Toby! Thank ya for sharing

I inadvertently used Yahoo! for an ugly sort of DDoS on multiple search engines and sites.

Haha! Love it. 😆

I also love that everyone was more curious about how and why it happened versus trying to put blame on anyone. That sounds like a good, healthy environment to be in.

And I so agree with ya about folks learning lots from those moments when someone breaks stuff. Nothing like a painful mistake to help ya learn something! Said the man who has made many a painful mistake, haha. 😅

Comment button Reply

CollapseExpand

UPDATE users SET password='...';

Comment button Reply

CollapseExpand

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

Comment button Reply

CollapseExpand

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. 🤣

Comment button Reply

CollapseExpand

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

Comment button Reply

CollapseExpand

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

Thread

Thread

CollapseExpand

New branch for debugging, pulled from prod and not test. The picture speaks for itself….

Comment button Reply

CollapseExpand

CollapseExpand

Yep, was an interesting meeting the next day. That was the moment I disabled „auto-commit“ on every datagrip installation from then on.

Comment button Reply

CollapseExpand

Lol not nearly my biggest mistake ever but a particularly frustrating (and now funny one) back when I was building my photography section for my personal site:

I don't remember the exact filename but I had a file named something like "3DCssRenderer.js". I was developing locally on Windows and deploying to an Ubuntu server (obv not best idea as we'll learn in a moment but I was being lazy)

The code was working 100% fine on my machine but when deployed to the remote server the 3DCssRenderer.js couldn't be found which wasn't an error I was anticipating

After like 6 hours of tedious debugging I eventually realized the file was named 3DCssRenderer.js (uppercase C) but somewhere I made a typo and something was looking for a "3DcssRenderer.js" (lowercase c).

Windows isn't case sensitive but Linux is hence why it worked locally and not remotely (and of course it was "C" vs. "c" which isn't obvious at quick glance). Sure enough fixed the typo and it worked perfectly after that 😅 This experience has actually helped me a few times now helping colleagues solve similar bizarre bugs

Comment button Reply

CollapseExpand

Oh yeah Case sensitive or Line-Break difference between Windows - *unix Systems is something prob. everyone of us stumbled upon

Comment button Reply

CollapseExpand

Case sensitivity was one of those things I "knew" about but hadn't properly internalized until I encountered this error lol line breaks as well, I've def got a painful carriage return story or two floating around somewhere...

Comment button Reply

CollapseExpand

When I read the question, I immediately thought of starting CSS but on a shit*y foundation. It can't be the worst thing, but it sucks to start all over again when you've made good progress. 😶

Comment button Reply

CollapseExpand

I do feel that some of the gowns on display at Paris Fashion Week 2023 were the result of some badly-coded CSS: instagram.com/reel/Cn2KL2MMJwE/

Comment button Reply

CollapseExpand

lol, these are ridiculous!

Comment button Reply

CollapseExpand

CollapseExpand

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

Comment button Reply

CollapseExpand

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.

Comment button Reply

CollapseExpand

Not communicating when things started to go off rails from the estimate on a big development.

Comment button Reply

CollapseExpand

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.

Comment button Reply

CollapseExpand

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. 😅

Comment button Reply

CollapseExpand

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

Comment button Reply

CollapseExpand

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! 😛

Comment button Reply

CollapseExpand

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

Comment button Reply

CollapseExpand

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 😂

Comment button Reply


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK