24
TIL I had been indenting my code wrong for like 3 years
So I started learning Python back in 2020 (right when lockdown hit and I had nothing better to do). I was using Notepad++ because a YouTube tutorial said it was lightweight and good for beginners. The problem was, I never actually noticed I was mixing tabs and spaces for indentation. My code ran fine on my machine but every time I tried to share it on GitHub or paste it into a forum, people would lose their minds. Last week a guy on Reddit literally copied my code and was like "how does this even run?" and showed me the invisible mess I had made. I switched to VS Code (which highlights the issue in red), and now I just press Tab like a normal person. Has anyone else had a dumb habit that took way too long to notice?
2 comments