Friday, July 12, 2013

Agile Development Process

As a follow-up to a recent agile/scrum training we received from Platinum Edge we decided as a tech team to work on putting together some well-defined coding standards.  As an exercise during part of the training we were tasked with making a list of coding standards.  Our CIO/VP of Tech gathered the results of this exercise and then emailed the list of coding standards to everyone on the team asking for feedback.

The list of standards that was emailed contained some overly specific items like "Zend Framework" and some overly vague things like "Don't make it worse".  I gave this some thought and came up with some good standards that I believe would work well for at least our team if not most development teams.  My aim was to come up with some things that are not so specific as to limit your abilities but rather to keep code readable, maintainable, and easy to debug.  The standards are as follows:

Code
  • No superfluous whitespace/blank lines, whitespace should be clean and logical
  • Indentation should be logical and consistent
  • Functions/methods should do one thing and do it well
  • Use descriptive names in code
  • No naked control statements (if, for, while)
  • Use comments where code may be unclear but don't overdo it
  • Consistency above all
Practices
  • Fix problems you may find along the way (ie. take ownership of the code)
  • Follow standard security practices (eg. filter all input, register_globals off, server-side authorization, etc.)
  • Adhere to industry best practices and design patterns (eg. RESTful API's)
  • Document functions/methods (standard xDoc formatting)
Other
  • Logical version control (eg. no more than one feature per commit, feature branches, etc.)
  • Test Driven Development
The majority of the code we work with is PHP, hence some of the example references.  In general the standards you may choose should fit with your projects and your team of developers and should be agreed upon by everyone.  I would argue that pointless debates such as tabs vs. spaces shouldn't be set as a coding standard necessarily but instead should fall under something like my "consistency above all" standard.  In those situations just pick an option and stick to it as a team.

0 comments:

Post a Comment

Subscribe to RSS Feed Follow me on Twitter!