June 26, 2004

C# Style Checking Tool

At Vanguard we had really strict Java code formatting conventions. It drove some people nuts but most people came round to the advantages in the end. With a fixed style, all the code in the company is written to a higher standard as people take more pride in their work. It is easy to do code reading and refactoring as there is no need to reformat the code. Arguments about the one true brace layout style or tab indentation size go away because the chosen style, whatever it is, is the law. People who can reliably code to a set format also tend to reliably code to a set specification. At that time, I started use CheckStyle to check my own code and would have liked to have included it in the pre build checks to warn of coding violations. Using a tool to verify the code also helps as you can't argue with the tool and niggling about badly formatted code becomes less personal.

If you search Google for java code style checker the first site that comes up is the Checkstyle Home Page.

If you search Google for C# code style checker you get links to various Coding Style Guide documents.

I would have thought that someone would have ported CheckStyle to C#. Maybe C# programmers don't care about their code looks...

Posted by stuartcw at June 26, 2004 01:12 PM
Comments

well also, IDEA and Eclipse has some pretty decent code formatters. With IDEA , whole project can be formatted (including xml files) with one key combination. I had got used to use { symbols next to the blocks, but my new supervisor hates it, so it was a breeze to use IDEA on that aspect..

Posted by: aaa at June 27, 2004 01:26 PM