Way to support different coding styles in a development team

coding-style

The Problem: Two developers => three opinions on indention, braces on new line or not etc.

We usually work with three or four people on our projects and each of those has it's own code style. I know, the common solution is to agree on a code style, everybody has to use, but I don't want to force creative programmers in a suit that does not fit them.

So the question is: Is there a way to let each programmer live his/her own style, but having a common code base inside the repository? I think of some git/svn/whatever plugin, which changes between personal and common style on checkout and commit. It appears to me, that the tricky part in this approach is to support correct diffs between the versions of a file

Best Answer

No, you will need to make a standard. If you have team member B change (either with an automated IDE tool, or manually) a whole heap of code team member A wrote, that will be committed and show as a change.

This is something almost every team faces and standards are "forced" for this very reason. I would suggest you follow the language authorities standards as a baseline and adopt them to suit your team.

Having a consistent coding style will also help in the maintainability of the project and reduce the barrier to entry for new people working on the code.

Related Topic