Monday, May 07, 2007

Introverted Programming: Job Security Pattern

Have you ever felt underrated? The main reason is that people can understand what you are doing and it gives them a feeling that you are replaceable. You can proof them wrong with few simple techniques.

1. You should agree (and some managers may support you), that this code

public void DoFunc(string n, int num)
{
try
{
SqlConneciton conn=new SqlConnection("server=treaudo;security=SSL;usr=gh#6d;pwd=HyhJ76J;");
conn.Open();
SqlCommand cmd=conn.GetCommand("spDoIt");
SqlDataReader rdr=cmd.ExecuteReader();
while (rdr.Read())
{
MyObject mo =new MyObject(rdr,n);
mo.SendMessage(num);
GlobalCacheVairable.Increment(mo.Quantity);
mo=null;
}
}
catch {}
finally
{
//close all the stuff
}
}
looks more sophisticated, than this one:
public void DoFunc(string n, int num, SqlConneciton conn)
{
using (SqlDataReader rdr=GetDoItReader(conn))
{
while (rdr.Read())
{
ProcessMyObject(n,num,rdr);
}
//we still catching errors
}
}
Also there is a pretty good chance that the former spread all over the project located in several key areas and only Tom or Mike will agree to maintain it. So who will keep their jobs when the tough times come? Considering that the latter piece takes twice as much time to build (especially when those silly unit tests are around), the hardworking Tom and Mike look 4 times more productive than always malcontent Chad and Martin.

2. It is tempting to give your classes and methods misleading names but do not leave your opponents enough ground to accuse you of sabotage. The class names like Utilities or Flickr WCalcST will do. Method names shouldn't resemble verbs and something like TotalRecall always adds a nice touch to the ASP.NET code-behind.

3. People, who operate with terms like cohesion, are you enemies only want to make your classes more transparent, so the next-desk guy can easily replace you! support your code. It's an easy catch: if your classes are never less than 600 lines of code, even toughest agile junkie would consider an easier prey.

4. If you are tempted to add another #region block in your code, because navigation throughout the class is getting tedious - you are on the right way. Classes with a dozen collapsed regions look exceptionally solid.

5. Beat them with their favorite weapon - the innovation. Thoroughly spread generics and reflection throughout the places they less expect. With the method DoLwBack<Dictionary<string,ConfCol<int>>>(input1, input2) you will live up to your reputation of sophisticated programmer.

6. Work alone. Communication let others to spy on your plans and give away your productivity (which you most likely have to camouflage).

Some other useful techniques were discussed at the Niagara Falls, NY conference Waterfall 2006.

No comments:


© 2008-2013 Michael Goldobin. All rights reserved