All of what follows in this post is based on two core principles:
- Teaching and explaining a topic is the best way to master it; and
- The ideals of a community are best handed down from individual to indivdual as they work toward a common goal.
Toward that end, on May 11th, the Portland Drupal Users Group will be using our monthly meeting to run code reviews.
As a side note, while this writeup uses Drupal as an example, the general principles will work across projects, or in training/educational contexts outside software development.
Code reviews can help grow the existing pool of talented Drupal developers by providing a documented, more structured way for developers new to Drupal to begin learning the Drupal codebase, and learning how to work within the community that maintains with that codebase. Code reviews can also help alleviate one of the more consistent bottlenecks for developers looking to contribute more to Drupal: the project review process.
Code reviews reinforce good habits. The process of reviewing someone else's code forces a few things to happen:
- The reviewer hones their developer chops by seeing how other people have solved problems;
- By reviewing code for security issues, developers get more familiar with the best practices for writing secure code, and security issues in exiting code can be addressed;
- By reviewing code for proper and appropriate use of Drupal's APIs, developers get more familiar with Drupal's APIs, existing modules get more stable and less likely to break on upgrades, and more people become familiar with how core works;
- By testing and reviewing code via the Coder module, and/or using Devel as needed, easy fixes get implemented more quickly;
- Opportunities for documentation and better test coverage can be highlighted as part of the review, leading to more automated review and better documentation.
But, most importantly: the process of providing a review of someone else's code creates a dialogue within the community. Code review is contribution and connection, and these are key elements to working successfully in the Drupal community.
Additionally, code reviews provide a clear starting point for people asking how to begin in Drupal. Not many people are going to start reading api.drupal.org without a clear context or reason to do so. Code reviews provide that context, and the process of a code review provides a structure for people coming up to speed on Drupal development. So, when someone says, "I want to get started in Drupal, but I don't know where to be begin," we now have a simple answer:
Check out this page for some background on giving code reviews, and then review some code. The process of reviewing projects will get you up to speed on how to develop in Drupal.
To summarize, code reviews:
- Help new developers learn Drupal development best practices;
- Help new developers make contributions and connections within the community;
- Help reduce the bottleneck of getting new projects approved. And, it's worth noting that increasing the visibility of code reviews as a valued contribution within the community will likely increase the pool of reviewers into the future.
There are a large number of local user groups. While a lot of work can be done virtually, the value of face to face meetups should not be overlooked or underestimated. Local user groups provide an opportunity for more exerienced and less experienced developers to get together and share ideas. If user groups dedicated one to two meetings a year to code reviews - where more experienced and less experienced developers worked together on code reviews - the habit of code reviews could start to become a recognized norm. Once a developer has become proficient in code reviews, the practice of reviewing someone else's code can just as easily be applied to reviewing their own code.
Over time, code reviews should be as familiar and as recognized as Code Sprints and Documentation Sprints. These are held at every DrupalCon, and are regular occurrences at local Drupal Camps. Given the value of code reviews in developing new talent, increasing the consistency and quality of contrib, improving collaboration between developers, and strengthening the contributions of local user groups, code reviews have a role to play in helping the Drupal community continue to grow, evolve, and mature.
The Code Review Group is getting up to speed, and you can indicate on your profile that you are actively reviewing code. This wiki page and this handbook page both provide instructions for diving in to a code review.
And, if you are in Portland this May 11, come to the Users Group meeting and get running with some reviews.