If you are someone looking to find a developer / contractor / consulting firm that can write that mission critical or critical line of business application for your company that will put you on the map, you need to consider something before contracting the developers.
Just like you get a $9 bottle of red wine that tastes like watery sweetened red cool drink, compared to a $30 bottle of Black Widow or Dirty Laundry that tastes like mature, fruity red wine, you cannot just contract any developer and expect great results. Developers come in different flavours. Usually - but not always - the good ones cost much more, but there is normally great benefit in getting an experienced, mature developer as opposed to a cheap knock off. Now do understand - I am not saying a developer's rate is necessarily a reflection on their skills, as some developers are really good, just have not yet made a name for themselves so they price themselves competitively.
Consider a piece of code in your LOB application that needs to validate a Canadian postal code, which usually consists of two groups of three alphanumeric letters, optionally spaced by a single space character. So the pattern is:
ana nan
or
ananan
where a is in the set {A-Z} and n in the set {0-9}.
If you do not read computer code, fear not. Squint your eyes and abide by the generic rule that less is more. Look at the code from a green developer having very little experience writing enterprise applications.
private bool ValidateCanadianPostalCode(string s)
{
bool rtn = true;
// Only validate Canadian Postal Code!
s = s.Trim();
string s1 = "";
string s2 = "";
string s3 = "";
string s4 = "";
string s5 = "";
string s6 = "";
string s7 = "";
if (s.Length != 6 && s.Length != 7)
{
rtn = false;
return rtn;
}
else
{
if (s.Length == 6)
{
s1 = s.Substring(0, 1);
s2 = s.Substring(1, 1);
s3 = s.Substring(2, 1);
s4 = s.Substring(3, 1);
s5 = s.Substring(4, 1);
s6 = s.Substring(5, 1);
}
if (s.Length == 7)
{
s1 = s.Substring(0, 1);
s2 = s.Substring(1, 1);
s3 = s.Substring(2, 1);
s4 = s.Substring(3, 1);
s5 = s.Substring(4, 1);
s6 = s.Substring(5, 1);
s7 = s.Substring(6, 1);
if (s4 != " ")
{
rtn = false;
return rtn;
}
else
{
s4 = s5;
s5 = s6;
s6 = s7;
s7 = "";
}
}
rtn = IsCanadianPostalCode(s1, s2, s3, s4, s5, s6);
}
return rtn;
}
private bool IsCanadianPostalCode(string s1, string s2, string s3, string s4,
string s5, string s6)
{
bool b = false;
string sc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
string sn = "0123456789";
if (s1.Length == 1 && s2.Length == 1 && s3.Length == 1 && s4.Length == 1 &&
s5.Length == 1 && s6.Length == 1)
{
if (sc.Contains(s1) == true && sc.Contains(s3) == true &&
sc.Contains(s5) == true && sn.Contains(s2) == true &&
sn.Contains(s4) == true && sn.Contains(s6) == true)
b = true;
}
return b;
}
That code basically splits the two potential formats (with and without space) into single characters, and validates each character against a predefined set of characters individually. I am not going to explain why that code is awful, but do keep in mind you usually pay a developer for his time, so imagine how long it takes to type that part of your application.
Now compare that to this alternative version that I just concocted:
private bool IsCanadianPostalCode(string code) {
return
new Regex(@"^[a-zA-Z][0-9][a-zA-Z][ ]?[0-9][a-zA-Z][0-9]$").IsMatch(code);
}
Forget the weird pattern you see for a moment - remember, we are squinting here - which looks faster to write? Which is more robust? More lines of code translates to a higher probability of bugs.
Point I am trying to make is that you get what you pay for, and you need to ensure you pick someone who will be the best return on your investment because at the end of the day, your business will depend on the quality of the systems you run your business on. You cannot build your business on sand and expect it to survive. Invest properly and reap the benefits of quality code, equivalent to building your company on solid rock.