V
18

Update: The 6-month difference between messy code and readable code blew my mind

Honestly, when I first started learning Python three months ago, my code was this tangled mess of variables named 'temp1' and 'temp2' with no comments anywhere. I had a function that was 200 lines long doing everything from reading a file to calculating stuff to printing output. I couldn't even understand what I wrote after a weekend away from it. Then I watched a YouTube tutorial from a guy in Austin who showed before and after screenshots of his own code. He explained how using functions, clear names like 'get_user_input' and 'calculate_total', and a few comments made everything 10 times easier to debug. I spent a whole Saturday refactoring one of my old projects and I swear it cut my debugging time from 2 hours to 15 minutes. The weirdest part was noticing how much less frustrated I felt when I opened my own code later. Has anyone else had that moment where you look back at your old beginner code and just cringe at how messy it was?
2 comments

Log in to join the discussion

Log In
2 Comments
williamw75
williamw753d agoMost Upvoted
Yeah cleaning old code feels like finding moldy food in the back of your fridge.
7
shane_bell
More like finding expired milk and hoping it's still good.
-1