Our specific situation is that we are creating an agreement between ourselves and another team for shared control or use of a PHP based web application that we have been building. We have a set of standards and conventions documented in our technical specs. However, I have been asked to define them in terms of an industry standard.
I am aware of different terminology for coding conventions. Hungarian notation, CamelCase, for example. And some defined standards for very specific things, PSR-0 for example covers namespaces in PHP.
It seems the point is to try to give us stronger ground in the agreement, by pointing to industry standards rather than an arbitrary standard we set forth. They’re looking for things like the PSR-0 or an ISO#### or IEEE#### that we can point to.
My personal concern is that I’ve spent the time working with the team to show them the standards we have and to get buy in on the bigger parts of it. So I’m worried we’ll either end up having to conform to some standard that doesn’t match how we like to program, or the better case will be picking and choosing pieces of standards if they exist, to fit our current conventions.
Anyway, the core of the question is, Are there any industry standards regarding code quality, coding processes, or other areas that would help us keep their programmers from making disruptive or difficult to maintain code? I realize we can’t prevent it, but if we can point to the agreement, at least we have recourse other than refactoring or recoding it ourselves.
Any other thoughts or suggestions would be helpful.
12
Well, there are the standards put forth by the PHP Framework Interoperability Group.
Then there are the standards put up in reaction to the PHP Framework Interoperability Group: The Difinitive PHP Style Guide.
And then there’s Apache’s style guide.
So, no. Nothing that’s been agreed on by the industry.
1
Industry standards are subjective. The field is so full of competing ideas that you can always find someone who will prefer another approach over even those that are recommended in some manifesto. What matters is consistency within the organization. That trumps industry standards.
The reason being is that sometimes organizations have good cause to take a less favored approach. For example, I have worked on a lot of government contracts. The government has a tough time attracting and keeping top-tier developers. As such it tries to code in a very general, entry-level developer kind of manner. They want it to be easy to bring in new developers. They also want it to be easy for developers to move between projects. Thus, they try to keep the coding style across projects homogeneous and explicit. By explicit I mean they favor coding things outs vs. having things magically happen (look at an ActiveRecord definition in Rails and you’ll know exactly what I mean by “magic”).
No two organizations have the exact same priorities. As such, there may be good reasons for their standards to vary. Consistency is what matters.
2