6
Shoutout to the guy who fixed my code with one comment at a Philly meetup
I went to a coding meetup in Philly last month expecting to network and grab free pizza. Some guy looked at my messy JavaScript project and just said "you're overcomplicating the loop." He showed me a simpler approach that cut my code from 40 lines to 12 in like 5 minutes. I always thought harder meant better code but that changed how I write everything now. Has anyone else had a stranger totally flip how you code?
2 comments
Log in to join the discussion
Log In2 Comments
joseph4481mo ago
Man, that story hits close to home. The thing nobody talks about is how hard it is to unlearn the "more code = smarter" mindset once you've been doing it a while. I had a similar moment at a hackathon where some random dev told me I was nesting if statements like a staircase and could just flip the logic around with an early return. Cut my validation block from 15 lines to 4. Now I look at my old code and cringe at how much I was overcomplicating stuff just to feel clever. It's like learning that simple isn't lazy, it's efficient.
4
bettyhunt1mo ago
Back in 2008, I was working on a donation form for our church website and had 19 nested conditionals checking address fields. A younger programmer took five minutes to show me that combining zip code and state validation into one regex call, then using guard clauses, brought it down to 5 lines total. That moment changed how I approach every piece of code since then. Now when I start writing a big block of conditions, I stop and ask myself if there's a simpler way to check for the opposite case first. It took me a good six months of catching myself before it became natural to reach for early returns instead of deep nesting.
7