20
Got told my code was 'spaghetti' by a friend who actually knows what they're doing
I showed a friend my first Python project, a simple number guessing game. He looked at it for a minute and said, 'This is spaghetti code, man. Everything is just in one big block.' He pointed out I had all my logic, input, and output just piled together. I spent the next week, maybe 10 hours total, learning about functions. I split the game into separate functions for getting the guess, checking it, and running the main game loop. It's way easier to read now, and I can actually fix bugs without breaking three other things. Has anyone else had that moment where you realized you needed to structure your code better?
2 comments
Log in to join the discussion
Log In2 Comments
the_anna4d ago
Welcome to the club, we've all been there.
3
the_anthony4d ago
Yeah, the initiation fee for this club is way too high. They really need to work on the membership perks.
4