Luca says to leave the code better than you found it
Camping can be fun to be out in the wilderness. Fresh air in the morning. The quiet solitude of waking up with the birds.
As we explore the outdoors we need to leave the campground better than we found it. Luca Rossi recommends we do the same with our code.
Leave the code better than how you found it.
When you touch some code look for ways to clean it up. Refactor the design to make it easier to read.
Don’t leave a mess for others. A co-worker of mine once printed out a long method. He hung it outside his cube. It was a mess that many people had touched. It only takes a little time to tidy things up.
Create Small Pull Requests
Working in Scrum we have short sprints. They give us a timeline to complete our work. Another tip from Luca is to create small pull requests. Similar to the work of a Scrum team. Small focused time blocks.
Commit Frequently
I am old enough to remember when we had to save our work. In college, I typed a few pages in the computer lab. Then the power went out and my work was lost.
Luca suggests we commit frequently. I agree as our code repository can help us track our changes. For example, I may try a few different changes. Then I want to go back to an early version.
Pair Up
When my daughter was in Kindergarten her class took a field trip to the Science center. Each kid had a buddy to stay with the whole day. As the only father in the class, I had to take ten boys to the bathroom. I was a traffic cop keeping them together.
Pair programming is one of Luca’s favorite ways to work. The extra set of eyes helps spot bugs. Along with keeping us on track. Less time on social media or looking for music to listen to.
Take a break
After working from home for a few years now I realize I can’t sit very long. When I have a long meeting I use my standing desk. Or even walk around my office.
Luca proposes we take frequent breaks to avoid tunnel vision. Getting away from the code can help us clear our heads. We can see new possible solutions. Bruce Tate had related advice.
Ask, Ask, Ask
Luca’s last bit of advice is to ask a lot of questions. He wants us to talk to the Project Mangers and stakeholders. We need to understand what they need.
What great tidbits from Luca. As we visit a codebase leave it better than you found it. Create small pull requests and commit frequently. This sounds similar to Ron Jeffries's advice. Pair up and take breaks.