O
14

A code reviewer told me I was overcomplicating things and it clicked

I had been working on this little project for like 2 weeks, making these long functions with tons of if-else statements. Finally asked a guy I know from a local meetup in Austin to look at my code. He just said 'dude, you're trying to be too fancy, just break it into smaller pieces.' So I started splitting everything into tiny functions and using a simple switch statement instead. Now my code is way easier to read and I actually finished the project in 3 days. Has anyone else had a simple piece of feedback that totally changed how you write?
2 comments

Log in to join the discussion

Log In
2 Comments
morgan915
morgan9151mo ago
Ugh the "trying to be too fancy" line hits hard because I've been THAT guy writing 80 line functions just to prove I know what a ternary operator is. Breaking things into tiny pieces is basically cheating at programming because suddenly your code reads like a children's book instead of a cryptic puzzle. I had a team lead once tell me to pretend every function I write will be read by someone with a hangover at 2AM and that FINALLY made me stop nesting ifs three layers deep. Simple wins every time but we all have to learn it the hard way first apparently.
2
casey843
casey8431mo ago
That hangover advice is gold honestly. I remember reading somewhere that the best code is the code you can walk away from for a month and still understand on the first read. Took me way too long to realize that clever tricks don't impress anyone when you gotta debug it at 3am. Breaking things into tiny pieces is definitely the cheat code though, feels like you're doing less work but somehow everything just works better. Simple code is just easier on the brain, no shame in it.
5