Does your team have a formatting standard?
Tags: career, discuss
Published: 2019-02-04 23:00:27

---
title: Does your team have a formatting standard?
published: true
description: 
tags: #career,#discuss
---

As I stated in my [previous post](https://dev.to/theothertimduncan/my-developer-story-1b55), working with other developers is an area where I struggle, both as a leader and as a member of a team. As an introvert and possibly slightly autistic, interacting with other humans at any level can be difficult for me. 

I know my struggle is common. This industry tends to attract the misfits like me that prefer the logical interaction with 1's and 0's instead of the messy analog world. Unfortunately for us misfits the days of the lone programmer in a dark corner of the basement accomplishing something no longer exist. And possibly never did. It takes a team to accomplish something. And despite that "unfortunately" above, I think that's a good thing.

Good thing but challenging. Over the years I've gotten better at interacting with others. My current job has actually helped with identifying areas where I could improve and learn. But it's also been very frustrating at times. I'm also a perfectionist with a little OCD, so it can be really difficult to tell whether I'm someone who pushes for quality or just an arrogant nitpicking asshole.

Which leads me to my question for today. I've been struggling - and procrastinating - on how to continue from my previous post with some of the issues I've been struggling with. Then I ran into something last week that felt like a good starting point. Does your team have a formatting standard? And maybe more importantly, how do you enforce it?

For that last question, I believe that the actual answer is you don't. There are multiple ways such as linting to automatically clean up code before it is ever committed. But to highlight the first challenge with my shop, we can't even agree on tooling. We're a .NET shop, so we primarily use Visual Studio Professional. I remember once mentioning in a meeting that a simple keyboard shortcut - Ctrl-K,Ctrl-D - handles the majority of the formatting clean up for you. The response I got from one person - the one I consider the sloppiest as well - captured the problem perfectly: "I don't have time to learn new keyboard shortcuts.".

Which version of Visual Studio we use has been a continual source of conflict. It's only been a couple years since I managed to get us to switch from VS 2010 to 2015. Let's not even mention the arguments over the last year around switching to VS 2017. Some of us have switched (like me), but for the most part, VS 2015 is what is expected to be used. That leaves out the option of taking advantage of using [.editorconfig](https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2017). I did create one for all the projects I'm responsible for so at least those who use VS 2017 will be affected. I know there is an extension for VS 2015 to add support for .editorconfig. For that matter, I've personally been using [CodeMaid](https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaid) which would work in either version. But I haven't even tried starting a discussion over what extensions everyone should be expected to be using. I already know how that discussion would go.

Let's get more specific. I have a codebase that I'm been the sole developer on for several months. Another developer has recently started working on it while I'm on a different project. To protect the guilty (ok, I'll be nice - innocent), let's call him D. D has been in the business for decades. He once worked at Compuserve as an example. And D is the biggest point of conflict for Visual Studio versions and other areas. But one point that he does repeat that I actually agree with is consistency. In some of the discussions we've had regarding a formatting standard, he has stated that it is more important to be consistent with the existing code. Except, I guess, that doesn't apply to him.

This is one example of how I format my code and is how everything is formatted in this codebase.

![Existing formatting](https://raw.githubusercontent.com/TheOtherTimDuncan/TheOtherTimDuncan.github.io/master/images/posts/FormattingStandard/Standard Formatting.png)

In the code that D has been submitted, he's used two different formatting styles. I also find it "interesting" that he doesn't always follow the C# convention of Pascal casing for the property names. I know that class is meant to represent a database table and that table probably has columns capitalized that way (and yes, that database is that horrid but that blame lies elsewhere). But I don't know if he realizes that capitalization mismatches won't matter or if he's thinking he has to match the capitalization because "reasons".

![Non-Standard Style](https://raw.githubusercontent.com/TheOtherTimDuncan/TheOtherTimDuncan.github.io/master/images/posts/FormattingStandard/NonStandard Formatting 1.png)

![Non-Standard Style](https://raw.githubusercontent.com/TheOtherTimDuncan/TheOtherTimDuncan.github.io/master/images/posts/FormattingStandard/Non Standard Formatting 2.png)

Based on previous discussions with D, if I bring this up with him, the most likely response I would expect to get is that it doesn't matter and that it's more important the code works than that it's consistent or "pretty". What do you think? Do I need to turn down the OCD a notch and just let this go? How would you handle this situation?