If you were to ask me if I thought of myself as being a creative person, I would respond with an affirmative “No”. When in fact I know that I am. You really have to be in order to be a developer. There will be very few situations (if any) in your programming career where specifications will be given to you that read like the instructions that come with a lego kit. In fact, if they did, what programmer would really want the job? We need to be able to express ourselves through our code, otherwise what fun is it to code?
The reason I steadily answer no is because when I try to be creative, I lock up and fail miserably. Think of it as you would writers block. It applies to any topic that puts me on the spot to be creative (and is probably due to some inner anxiety that I have). When I don’t try to be creative I usually overdo it. For example if you were to give me a problem that needed to be coded I would undoubtedly come up with a very creative solution at first, but it would probably not be the simplest (or most efficient) solution. When trying to think up names for solutions, projects, collections, etc., it is inherently apparent at how uncreative I truly am! In code however, we have refactoring and can go back later to change it up as we see fit.
When dealing with small projects this is all very trivial as it does not usually take much effort to change things around. When you get into distributed programming, this is not so. One minor change in your solution can affect many other projects, even those that do not pertain to the solution in which you made the change. Many different coding paradigms aim to fight this tight coupling of code and I subscribe to as many as possible (IoC, DI, etc.). Legacy code is the real killer. If you have an entire distributed system of legacy code it will more than likely be tightly coupled. Legacy systems are usually far too large to rewrite completely and are generally broken into components and rewritten in pieces (if at all). As new projects get added into the system, you want them to be loosely coupled, yet they have to work with the tightly coupled system. This demands creativity! All in all, it is not as hard as it is frustrating. At least it is modifiable and not set in stone.
So if we are starting a new project, we need to look ahead far enough to realize that what we code today, is going to be rewritten tomorrow. Whether it is a simple refactoring or a complete rewrite, nothing is permanent, least of all our code. Being that, I am very comfortable with change. I become disgruntled when I see developer tools that do not embrace this theory. Especially when they come from Microsoft…
If you are familiar with TFS 2010, you will know that there is a hierarchical structure to their team setups. You have:
A Team Collection (which holds all of the collection’s team projects)
A Team Project (which holds all of the team project’s solutions)
A Solution (which holds all of the solution’s projects)
A Project (which holds all of the project’s source code)
If you do not develop with TFS, then you should at least be familiar with solutions and solution projects (assuming you subscribe to Visual Studio). When you create a new project, you are prompted to add the project to a new/existing solution.
– Scenario –
So you create your project, “MyToolConfigUtility” and add it to your new solution, “MyToolSolution”. “MyTool” is a product that is part of a distributed legacy system. The legacy system has 3 other main products and they each have their own configuration utilities. So you get in there and hammer away at code and in a while have a working application to configure your “MyTool” application.
Since we are using TFS, we have also created a team collection called “MyCompaniesMainLineCollection” (for which will contain all of the projects that are part of the main line of software sold to the end user). Within this collection we have also created a “MyToolTeamProject” (which will contain any solutions that are inherent to the “MyTool” product). Personally, when I create my team projects, I tend to keep them to a single solution and just add projects to the solution for each different facet of the team project.
Our hierarchy looks like this thus far:
| (team collection) |
tfsserver\MyCompaniesMainLineCollection |
| (team project) |
MyToolTeamProject |
| (solution) |
MyToolSolution |
| (project) |
MyToolConfigUtility |
After a few months, it comes to the attention of the designers/architects that a lot of the configuration utilities (4 of them currently exist) share the same algorithms and procedures. However, 1 of them is written in VFP, 2 of them are written in unmanaged c++ and yours (MyToolConfigUtility) is written in c#. It has been decided that they all need to be combined into one c# implementation. This shouldn’t be too hard since they all basically do the same thing and you have most of the code already written in your MyToolConfigUtility project. However, the recoding is not the issue. The naming scheme is. This MyToolConfigUtility is no longer that, now it should be named the “MyCompanyConfigUtility”. So we want our hierarchy to look as follows:
| (team collection) |
tfsserver\MyCompaniesMainLineCollection |
| (team project) |
UtilityTeamProject |
| (solution) |
ConfigUtilitySoluction |
| (project) |
MyCompanyConfigUtility |
With the above changes, we can simply add what was missing from the MyToolCOnfigUtility and whamo, we are good to go. Anyone that inherits our codebase later on should understand what this team project is just by looking at the previous hierarchy. The above however, is impossible. In TFS, you cannot rename a team project…WHAT?! :: sigh ::
At this point I find myself faced with two options. Either I change what I can, and leave the rest as it is:
| (team collection) |
tfsserver\MyCompaniesMainLineCollection |
| (team project) |
MyToolTeamProject |
| (solution) |
ConfigUtilitySoluction |
| (project) |
MyCompanyConfigUtility |
(which now makes no sense at all) or I start a new team project and copy over the solution into it. Moving the source code is not that difficult, but everything has to be done manually and if you are using the built in SharePoint portals, then may God have mercy on your soul (as they add an entirely other level of cluster fuck). Personally, I have chosen to start a new team project. Luckily for me, one of the companies I work with where this situation occurred does not yet use the SharePoint portals so the move should only take a little while.
– Avoiding the Disaster –
Having a set of specifications and a roadmap will help to alleviate these incidents. In the previous example, all of the company projects were created by different teams that worked in different environments, using different languages and only communicated when absolutely necessary. The good news is that a company that communicates regularly amongst their development teams and keeps an up-to-date roadmap (Agile?) will tend to avoid these situations all together. The bad news is, that from what I’ve read, seen and personally experienced, companies do not communicate well (in general), follow roadmaps or keep up-to-date specifications of their disparate systems. I am disappointed that Microsoft has not enabled us to rename our projects, but the underlying issue is that if you are ready for the issues when they eventually turn up (and they will) then you will not be caused such a headache!
Do it right, the first time! hehe.