O
7

The before and after of my first real code review

I spent about 6 months just writing scripts for myself, little tools to organize my moving company's routes and inventory. Nobody ever looked at my code, so I got real comfortable with 400 line functions and variables named 'temp2'. Then I finally got up the nerve to post a project on a beginner forum and a stranger offered to do a review over a video call, took about an hour. Watching him trace through my stuff, he pointed out that I had three separate loops doing jobs one loop could handle, and my error checking was basically nonexistent. I rewrote that same script over the next two weekends and it ran twice as fast, plus I actually understood it a month later. The big change wasn't the speed though, it was that I started naming things like my future self was going to read it, because hey, that's exactly who's going to. Has anyone else had that moment where a fresh pair of eyes made you feel both stupid and grateful at once?
1 comments

Log in to join the discussion

Log In
1 Comment
wesley_fox92
Hold off on the gratitude parade for a second. Yeah, getting feedback is nice, but you're making it sound like this random stranger saved your whole career with a few loop tweaks. Honestly, most code reviews are just someone else's opinion, and half the time they're pushing their own style on you. You said your script ran twice as fast, cool, but was it actually broken before? Billing still worked, deliveries still got organized, right? I've seen guys get so wrapped up in making code "clean" that they rewrite everything every few months and break half the stuff that was fine. And the naming thing, okay, I get it, but there's a middle ground between 'temp2' and treating every variable like a novel title. Maybe enjoy the speed boost and move on instead of turning one review into your whole new religion.
8