R
24

My brother in law made me realize I've been overcomplicating my code

He's not even a coder, works in sales. But last week he asked me what I was building and I spent 10 minutes explaining loops, arrays, and async functions. He just looked at me and said 'so you're just making a list that updates itself?' That hit different because he was right. I was so focused on writing clever code that I forgot the actual goal. Now I'm going back and simplifying a bunch of my stuff. It's way shorter and easier to read. Has anyone else had a non-coder point out something obvious you were missing?
2 comments

Log in to join the discussion

Log In
2 Comments
violafox
violafox4d ago
Why do you think simplifying is always better? Yeah, your brother in law got the gist of it, but sometimes those loops and async functions exist because the simple version would break under real conditions. I've tried cutting corners before and ended up with a buggy mess that took twice as long to fix. There is a line between overcomplicating and actually handling the edge cases you know are coming down the road.
6
william816
Wait, have you actually seen someone strip things down too far and regret it? I had a buddy who was a total overthinker with his code, always making these wild nested loops and complex state management for a weather app he was building. His non-coder roommate just asked why the temperature wasn't showing up right away, and he realized he could just use a simple fetch and display it without all the extra stuff. So he rewrote it using some basic promises and thought it was perfect. But then the app broke on weekends because he forgot to handle the API going down sometimes, and he spent a whole weekend fixing what he broke by being too simple. It's like, yeah, your brother in law nailed the big picture, but sometimes those edge cases are real and you need a little extra code to keep things working when stuff goes wrong.
4