Fell for a copy paste meme telling me to put semicolons after every line in JavaScript
Spent 45 minutes last Tuesday trying to figure out why my Rock Paper Scissors game kept breaking. Turns out I had been sprinkling semicolons into my if statements like an idiot because some joke post told me to. Deleted all of them and it ran first try. Any of you ever get tricked by fake coding advice when you were starting out?
Learned this the hard way too. Back when I was doing freeCodeCamp stuff, I got hit by one of those "you need to declare every variable with var or it'll leak into global scope" joke posts and spent a whole weekend adding var to things that didn't need it. The real killer was when someone told me to always wrap stuff in try/catch "for safety" and my errors got swallowed for two days before I noticed. My advice is to test the advice on a tiny throwaway file first. If you paste in a snippet and it works in a blank JS file, then try it in your real code. Also the browser console is your best friend here, just type it in and see what happens before you commit.