5 Steps to Fix Broken Code After a Change

Every developer has lived this exact moment. Your code is working perfectly. You make one small change just to test. Everything breaks completely. This is not a beginner problem. This is a coding problem. It happens at every level. Here is what I have learned when this happens: Step 1 — Do not panic. Breathe. Step 2 — Undo the change. Get back to what worked. Step 3 — Test one change at a time, never multiple at once. Step 4 — Read the error message carefully. It always tells you something. Step 5 — Google is not cheating. It is a tool. Use it. The best developers are not the ones who never break their code. They are the ones who know how to fix it. Breaking things is how you truly learn to build things. #Python #Coding #DataScience #LearnToCode #BeginnerCoder #Debugging #StudentLife

  • text

This happens all the time. #codingProblem

Generally as long as you spot the issue immediately after implementing a change, you're fine. Revert the change and move on. It is much worse if you find out the change in code you made broke something after multiple commits into development and realize that reverting the problematic commit also makes every other commit after it obsolete. Had it happen to me, multiple hours of development wasted. Always test your changes, even the parts of the program you think shouldn't be affected by your change.

Oh yeah. The moment that made me look stupid

Like
Reply

first rule of programming if everything working don't touch it

Actually, I also made the same mistake in my working model, which caused the entire model to collapse.

This will certainly make anyone super humbled.

The same thing happened to me few hours ago :)

What if by mistake you pushed it to main, instead of dev...

This happens to me last week lol.

I agree! Step 4 has was a recent game changer for me.

See more comments

To view or add a comment, sign in

Explore content categories