How to write better code » Thinking Inside a Bigger Box
The most important skill we should teach is how to work well with others on a shared code base. In my career, it took me many years before I started getting good at this, but it had the most impact on my effectiveness. So this is where I want to start with developers who are getting ready to join the work force. On almost all projects we work on, our success will depend on others.
Working with others can be taught. Here are some techniques that have worked for me:
- Pair programming. Good pair programming requires training, but there exists training styles like coding dojos and code retreats. Some of the best programming instructors in the world use pair programming actively as part of their training.
- Code reviews. I work so much with pair programming that I personally give code reviews a lower priority. But many teams find great value in them.
- Patience. When working with pair programming, it's easy to get stuck in arguments. Our profession says almost nothing about interpersonal skills, yet we depend on them all the time. Try this: When pair programming and you see your pair making a mistake, wait to see if she spots it herself before breaking in.
- Humility. I often get asked "how do I convince others to write clean code". Of course, the question assumes that you're right and they are wrong. Most of us are absolutely rubbish at the skill of changing our minds. When pair programming, if your pair want do something you think is wrong, try indulging them. At worst, you get the chance to teach them something. At best, you learn something yourself.
Read full article from How to write better code » Thinking Inside a Bigger Box
No comments:
Post a Comment