Browse DevX
Sign up for e-mail newsletters from DevX


Heard on .NET Rocks!: Cogan Rules

.NET Rocks! interviews Adam Cogan, Chief Architect at SSW, about rules for software development.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

am the host of ".NET Rocks!," an Internet audio talk show for .NET developers online at www.dotnetrocks.com and msdn.microsoft.com/dotnetrocks . My co-host Richard Campbell and I interview the movers and shakers in the .NET community. We now have over 170 shows archived online, and we publish a new show every Monday morning. For more history of the show check out the May/June 2004 issue of CoDe Magazine, in which the first column appeared. In Show #160 we spoke with Adam Cogan. Adam is the Chief Architect at SSW, a Microsoft Certified Partner specializing in Visual Studio .NET 2005, Windows and Web, SQL Server, OLAP and RS applications. At SSW, Adam has been developing custom solutions for businesses across a range of industries such as government, banking, insurance, and manufacturing since 1990 for clients such as Microsoft, Quicken, and the Fisheries Research and Development Corporation. We spoke about a large series of rules that he has published for software development, as well as general technology use.

Carl Franklin: [One] thing we are going to talk about this hour is your rules for software development. You have come up with a whole series of best practices that you have your guys use, and also have extended out to the community and even built some software around that. Adam Cogan: Yeah. Essentially my interest revolves a lot around efficiency and I express and implement them through standards and rules. And I guess I am after consistent outcomes and a consistent experience and quality. And so it's been a fair bit of time, implementing rules and just coming up with new standards.

Carl Franklin: How did this project start? Adam Cogan: I don't know really how it started. It kind of started in the very beginning it's….

Richard Campbell: I know. I am going to reveal a secret about Adam. I don't know if he necessarily wants it out but I know exactly where this has come from. What most people do not know about Adam is his history. Before he was a geek, what did the boy do for a living? Are you going to tell them? Adam Cogan: Oh! I was in the army. I was an accountant.

Richard Campbell: Here you go. Not only that but a tax accountant if I remember correctly. Adam Cogan: That's right. So I am not sure if I put it down to being an accountant, or being in the army, but I certainly became disciplined. I moved out of the accounting field because it's not real easy to [impress] chicks when you tell them you are an accountant and back then, geeks didn't have-I think geeks these days have an even worse reputation. At least the accountants go home and don't do any work.

Carl Franklin: So in other words, you do have an anal-retentive streak, Richard is saying. Adam Cogan: I think so. We created a series of Word documents and we put all the rules of how we were going to work. There was not too much technology back then and the rules we had were for dBASE and for Fox. Today they basically cover everything from exactly how to use e-mail and how to use Instant Messenger and how to set up your SQL Server or how you implement exception logging into your application.

Carl Franklin: And I even like the UI rules that you have; you know, about margins and buttons and fonts and things like that. Richard Campbell: And then naming conventions. All these things are valuable. I find interesting when I read this. You send all your employees here. This is like a handbook for working at SSW.

Adam Cogan: Yeah. We actually have a lot of internal rules as well, but anything that we can, we make public. There are essentially a lot of ways to do the exact same thing. If I ask a developer to show a set of records on a form, I don't know whether he is going to use the DataGrid or Repeater, or he is going to use datasets or objects or embedded SQL or stored procs or binding in the designer, or if he is going to bind in code. There are just so many choices that I don't want him to have to make. I just want him to do the same standard thing every time. I don't want him to name the projects in his app differently. I don't want to hear it called engine, I want it to be called business. I don't want to go through the argument on every project: are we going to use datasets or are we are going to use business objects? I want to say [that] by default we are using datasets unless there is an exception. So, I basically am reducing the choices of those types of arbitrary things. Richard Campbell: So it seems to me, as time has gone by, you have just sort of rounded up more and more of the thinking around these issues and put them all in one place. I mean, it's quite a gambit of things on your rules page.

Adam Cogan: Yes. This has many advantages and many disadvantages I guess. Like one of the biggest advantages it has is, we have a very simple induction process. When someone new joins our company, basically we have them up and running on large projects on the fourth day because we have the induction process which takes the first three days and during those days they learn exactly how to configure their PC with all the tools that we use and they learn how to estimate jobs and how they are going to speak to customers, exactly the way everybody else does. And when I say this induction process, I am not talking about reallocating another guy to act as a trainer. What they do is, they get their PC, they have got Web access, and they read all these rules and they complete a series of these small exercises, which confirms that they understand all the important pieces. Richard Campbell: It's basically an exam?

Adam Cogan: I would call it an exercise. Richard Campbell: Okay. You just want evidence that they have read and understood what you have asked them to read?

Adam Cogan: Correct. Carl Franklin: What is the vastness? What's the scope? How many of these rules do you have in this list?

Adam Cogan: Oh, I have never counted them to be honest. But there [are] 51 pages of public rules and each one of those possibly has about 50 each. So we are talking in thousands. There are a lot of internal ones as well; and obviously that number of rules has a downside. Carl Franklin: Right, discoverability, yeah.

Adam Cogan: Yeah. So essentially, there are many that are quite important and then there are many that are less important. We have rules [concerning the use of] curly braces. We [have] already had all the arguments on whether we have the curly braces on the new line or the same line. I am not going to have those arguments any more. We make a consensus, do a little bit of investigation, we make a decision, and that's the way it goes. Carl Franklin: It's good.

Adam Cogan: We have a lot of other things that are probably less important that you know that consume time. With Windows Forms, Microsoft actually has a guideline which [defines] the exact size of a button. Now, most developers don't bother with it. They randomly choose all these things. But I don't want it done that way. I don't want any time wasted on it. So I needed a way to automatically check these projects. Carl Franklin: Yes, so how do you do that? I mean, how do you go through 5000 rules by looking at-that's a lot of time wasted?

Adam Cogan: Well, essentially what I tried to do was automate as much of this code quality as I could. Just like the e-mail tool we developed. We then developed [a] tool to support these processes. So, we developed this tool called SSW Code Auditor, and it essentially uses the power of Regular Expressions. Every developer has to run this over before issuing their test which we call a test place. It must be Code Auditor compliant and FxCop compliant and we have another tool called SQL Auditor, which checks SQL Server. Carl Franklin: Excellent. And so, is this a sort of thing that runs automatically when you compile?

Adam Cogan: It's integrated into Visual Studio or you can run it [from the] Command Line or you can just use the GUI.

Thanks for your registration, follow us on our social networks to keep up-to-date