Skip to main content

How is your team staying DRY

DRY (Don't Repeat Yourself) is one of the basic fundamentals that developers are taught. If you find repeated code throughout your project you should move that code it into a method that can be the one spot that that code will exist. This reduces complexity and reduces the likelihood of bugs because the code is only in one place.

When I am presented with a new problem, I almost always immediately think of how I would solve that problem. What can I do, starting from scratch to solving the issue?

DRY should also apply to new code that you write, others have likely solved the problem you face, perhaps even with your team. Many times the problem has already been solved or a pattern has been established that will assist in solving the problem.  If you can use an existing piece of code you will save time and effort completing your task and be able to spend more time and effort on something else.

To keep myself and my team as efficient as possible, I need to first find out if someone has already done work that I can reuse. I need to reduce the amount of time I spend writing code that has already been written and focus on the details that are specific to my project.

What steps can I take to make sure I am not duplicating work? What resources do I have and what processes are in place to help me find existing work?

Everyone on the team should be able to answer the question, "How do you ensure you aren't duplicating work?" Their answer should be a list of steps they take before beginning to work or a resource they can point to as a centralized location of knowledge. If you ask a teammate this question and they don't have a good answer, then chances are that your team isn't being as efficient as possible. Knowing how to answer this question also benefits new teammates as they will have somewhere to start before writing new code and they will get an idea for standards that your team follows.

Here are a few things I have found work to help reduce redundancy with my team. Before any new work begins the developer that will work on the story will research what needs to be accomplished and come up with a plan of attack. This step usually takes between 1 - 4 hours depending on the size of the story.

After they have a plan detailed, they call a team huddle. The team huddle is a short, 5 - 10 minute, meeting of all available teammates. The developer explains the story and how they are going to complete the story. This huddle allows anyone else within the team to bring up instances where something has already been accomplished or point out any issue that could be solved in a more efficient manner. In a few cases this huddle has allowed for the entire story to be resolved without any new work, that is the ultimate in efficiency.

We also have a weekly developers meeting where we discuss questions that have come up throughout the week, set team standards, and learn as a group. We have spent time coming up with simple things like folder structure as well as more complicated things like how we shared data across different part of the project. We have had dedicated learning when the group felt it needed more training on a specific subject. No matter what topic has been covered, we have always gained more shared knowledge in the group and set ourselves up to take advantage of that shared knowledge.

Our team also has an internal resource where we keep record of any design decisions and coding standards that have been agreed upon. The goal is that if there is a question about something that has already been decided, we won't have to rehash all of the original arguments to come to the same conclusion because we can look up what was already decided. If things need to be changed then the resource is modified to reflect those changes. This prevents us from needing to have multiple meetings over the same topics, or returning months later to an issue that has already been solved.

How do you ensure you aren't duplicating work?

Comments

Popular posts from this blog

Converting a Large AngularJS Application to TypeScript Part 1

I work on a project that uses AngularJS heavily. Recently we wondered if using a preprocesser like CoffeeScript or TypeScript for our JavaScript would be beneficial. If our team is going to switch languages, we would need to be able to convert existing code over without much pain and we would have to find enough value in switching that it would be worth the conversion.

I had read an article that stated that because TypeScript is a SuperSet of JavaScript, you could convert a plain JavaScript file to TypeScript by changing the extension to .ts and not much else would need to change. I wanted to test out this claim, so I took a file that I was familiar with, an Angular Controller, and tried to convert it to TypeScript to see how much effort it would take and then try to figure out where we would benefit from using TypeScript.

This is what the controller JavaScript file looked like to start out with:
(function () { 'use strict'; angular .module('app') …

Converting a Large AngularJS Application to TypeScript Part 2

In part 1 I was able to take an Angular controller written in JavaScript and convert it to a TypeScript file while doing very little to change the code. In this post I am going to explore transitioning that same controller to actually use the features provided in TypeScript. This is how I left off my controller:
declare var angular: any; (function () { 'use strict'; var controller: any = function($scope){ ... } angular .module('app') .controller('controller', controller); controller.$inject = ["$scope"]; })();
While performing the translation from JavaScript to TypeScript, I would make sure at every step that the functionality I expected still worked, so if anything I did broke the system I would change it back and try again with another approach. Also if something seemed like it worked too easily, I would break it on purpose to make sure I wasn't getting a false result through browser caching a previously working fil…

Gamify TDD

I like it when things that would not normally be associated with games add concepts from games as a way to incentives you to accomplish things. Why simply go for a run if you can have an app that will track you and give you a gold star if you do better than you did the last time? Why go to the coffee shop that only gives you coffee if the other one will give you points that you can redeem for free drinks eventually?

I was recently introduced to CodeSchool, an online training system similar to PluralSight, it has video courses and challenges you can take to prove that you retained what the video taught. CodeSchool also adds badges and tracks to your learning, so as you complete a video and its challenges you get a badge. Complete a collection of courses within a specific discipline and you become a master of that discipline.

Some of these incentives are not tangible and really don't mean much in the real world, but they tend to work for me. If I start working towards a large goal a…