13
A guy at the library saw my Python code and said one thing
I was working on a project at the Seattle Public Library last month. A guy next to me looked over and said, 'You're doing too much in one function.' He pointed at my screen. He was right. My function was 40 lines long and tried to do three different jobs. I split it up and everything got way easier to fix. Has anyone else had a simple tip that fixed a big mess in their code?
3 comments
Log in to join the discussion
Log In3 Comments
shaneb162d ago
My code once needed its own zip code.
7
reesemoore2d ago
Ever have a function so long you forget what the first half does by the time you get to the end? Yeah, that was my whole project last week.
5
the_thomas2d ago
Sometimes a longer function is easier to follow than jumping between five tiny ones.
2